whitespace COMPANY whitespace SERVICES whitespace PRODUCTS whitespace PURCHASE whitespace SUPPORT whitespace CONTACTS whitespace Home whitespace Contact Us whitespace Site Map whitespace
whitespace
SUPPORT
whitespace
FORUM
whitespace
FAQS
whitespace
SUBSCRIPTION
whitespace
REQUEST ON-LINE
whitespace
whitespace

Technical Support Forum

Welcome Guest Search | Active Topics | Log In | Register

CandleStick and HiLoOpenClose custom colors Options · View
dll
#1 Posted : Saturday, August 14, 2010 6:53:23 PM
Rank: Member

Groups: Registered

Joined: 8/1/2010
Posts: 19
Location: LED
Did not find in samples, how can I set custom borders and fillings for CandleStick and HiLoOpenClose chart types, I mean settings custom coloring for positive/negative open/close variants ?
Baydalka Volodymyr
#2 Posted : Monday, August 16, 2010 12:25:31 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

Please, try to use next code to set colors for CandleStick type
Code:
series.setAttribute(ChartCandleStickType.PRICE_UP_COLOR, Color.WHITE);
series.setAttribute(ChartCandleStickType.PRICE_DOWN_COLOR, Color.BLACK);


Unfortunately, custom colors for HiLoOpenClose is not supported. But, you may set colors manually for each points (method : ChartSeries.getPoints().get(pointIndex).setBackColor())

Best regards,
Volodymyr Baydalka
Andriod development and support team
dll
#3 Posted : Monday, August 16, 2010 1:04:39 PM
Rank: Member

Groups: Registered

Joined: 8/1/2010
Posts: 19
Location: LED
attributes PriceUpColor, PriceDownColor are changing background only, right ?
How can I set various colors for background and outer border ?
Baydalka Volodymyr
#4 Posted : Monday, August 16, 2010 7:44:00 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

You may set color manually. Just try to use next method to setup colors.

Code:
public static void setupColors(ChartSeries series, Integer downPrice, Integer upPrice)
{
    ChartPointDeclaration declaration = series.getPointDeclaration();
    
    for (ChartPoint point : series.getPoints())
    {
        if(point.getY(declaration.OpenValueIndex) > point.getY(declaration.CloseValueIndex))
        {
            point.setBackColor(downPrice);
            point.setBorderColor(downPrice);
        }
        else
        {
            point.setBackColor(upPrice);
            point.setBorderColor(upPrice);
        }
    }
}


Best regards,
Volodymyr Baydalka
Andriod development and support team
dll
#5 Posted : Tuesday, August 17, 2010 8:53:59 AM
Rank: Member

Groups: Registered

Joined: 8/1/2010
Posts: 19
Location: LED
Tried to set custom colors as you suggested but it worked only partially :(

Here is the code I added after populating my chart points:

Code:
for ( ChartPoint point : series.getPoints())
        {
            point.setLineWidth(1);
           
            if ( point.getY(decl.OpenValueIndex)>point.getY(decl.CloseValueIndex))
            {
                point.setBackColor(Color.GREEN);
                point.setBorderColor(Color.GREEN);
            } else
            {
                point.setBackColor(Color.YELLOW);
                point.setBorderColor(Color.YELLOW);
            }
        }



But if you look at resulting picture, green/yellow has been applied only to borders, but backgrounds are still predefined - black and white. So setBackColor seems to be ignored.

What else needs to be done ?

Baydalka Volodymyr
#6 Posted : Tuesday, August 17, 2010 11:56:13 PM
Rank: Developers Team


Groups: Registered, Administrators

Joined: 7/28/2009
Posts: 447
Hi,

ChandeStick type uses PRICE_UP_COLOR/PRICE_DOWN_COLOR to fill backgrounds. Try to set it too.

Best regards,
Volodymyr Baydalka
Andriod development and support team
dll
#7 Posted : Wednesday, August 18, 2010 12:01:24 AM
Rank: Member

Groups: Registered

Joined: 8/1/2010
Posts: 19
Location: LED
Thanks, it worked ! :)
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Company | Services | Practices | Technologies | Career | Contacts | Privacy
© 2005-2016 ArtfulBits. All rights reserved.