Sign in to follow this  
simonfiction

Gradient on Single Series Bar

Recommended Posts

Hi,

 

I'm currently trying to style a single series 2d bar chart and I need to be able to add different gradients to individual bars. Is this possible at all? I can see how to add a base colour for every bar to begin a gradient from, but not how to specify an individual colour for each bar. The frustrating thing is I seem to be able to do this for multi-series charts.

 

 

 

Any help or hacks to get this working would be great! :)

 

 

 

Adam

Share this post


Link to post
Share on other sites

Hi,

 

 

 

Would this XML help?

 

 

 

 

 

<chart plotGradientColor=''>

 

 

 

<set label='Jan' value='462' color='ff0000,0000ff'/>

 

<set label='Feb' value='857' color='00ffff,ff0000'/>

 

<set label='Mar' value='671' color='ff00ff,00ffff'/>

 

<set label='Apr' value='494' color='ffff00,ff0000,00ff00'/>

 

<set label='May' value='761' color='0000ff,ff00ff'/>

 

<set label='Jun' value='960' color='00ffff'/>

 

 

 

</chart>

 

 

 

Please note the attributes:

 

 

 

plotGradientColor (whose value is blank to set of default gradient)

 

 

 

color (in each set - where i have provided individual graident colors, you just need to provide them separating each with a comma)

 

 

 

You can also use other attributes in <chart> element to control gradient globally:

 

 

 

These are :

 

 

 

plotFillAngle - (Number 0-360 If you've opted to fill the plot (column, area etc.) as gradient, this attribute lets you set the fill angle for gradient. )

 

 

 

plotFillRatio - ( Number 0-100 If you've opted to fill the plot (column, area etc.) as gradient, this attribute lets you set the ratio for gradient. )

 

 

 

plotFillAlpha - (Number 0-100 If you've opted to fill the plot (column, area etc.) as gradient, this attribute lets you set the fill alpha for gradient. )

 

 

 

plotGradientColor - (Color Hex Color You can globally add a gradient color to the entire plot of chart by specifying the second color as this attribute. For example, if you've specified individual colors for your columns and now you want a gradient that ends in white. So, specify FFFFFF (white) as this color and the chart will now draw plots as gradient. )

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