Sign in to follow this  
tyc

Different area color in area2D chart

Recommended Posts

Hi

I need to have a 2D area chart with y-axis range from -25 to +25, and x-axis as time interval, and what I want to show is when the data (area) is positive(above 0), the area color green and when the data is negative(below 0), the area is red.

I try that on old version 3.2 with flash, it kind of work with attribute 'color' under <set>, but when I upgrade to XT(v3.6, js only), that no longer work, and seem the 'color' attribute under <set> is gone. Can you tell me how to have two colors in 2D area chart?

Thanks.
 

Share this post


Link to post
Share on other sites

Hi

 

I need to have a 2D area chart with y-axis range from -25 to +25, and x-axis as time interval, and what I want to show is when the data (area) is positive(above 0), the area color green and when the data is negative(below 0), the area is red.

 

I try that on old version 3.2 with flash, it kind of work with attribute 'color' under <set>, but when I upgrade to XT(v3.6, js only), that no longer work, and seem the 'color' attribute under <set> is gone. Can you tell me how to have two colors in 2D area chart?

 

Thanks.

 

Hi,

 

Please note that you can now write JavaScript code in theme files to enable conditional formatting e.g., positive/negative coloring, index-based color code etc.

 

For more details on how to do that, please refer to the following JSFiddle.

Ref.- http://jsfiddle.net/sanjuktamukherjee/7w3LuoLk/

 

However, due to JavaScript chart limitation and an intended behavior for JavaScript chart, this feature would not work specifically for Area chart.

 

Hope this helps. :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this