Sanjukta

Adding color to displayValue in multi-series line chart

Recommended Posts

Hello,

 

 

 

I have a multi-series line chart and trying to add color (red) formatting for negative values. I am using the displayValue attribute to format my plotted values inside parentheses but can't seem to then get the color attribute to affect that displayed text. Setting the value to red instead changes the color of the line--not the displayed value.

 

 

 

Here is what I tried:

 

dataset seriesName='Operating Surplus (Deficit)'

 

set value='' /

 

set value='-314622' displayValue='(314,622)' color='CC3300' /

 

set value='-75062' displayValue='(75,062)' color='CC3300' /

 

set value='-139751' displayValue='(139,751)' color='CC3300' /

 

set value='-109104' displayValue='(109,104)' color='CC3300' /

 

set value='-190876' displayValue='(190,876)' color='CC3300' /

 

set value='' /

 

/dataset

 

 

 

But the color value was applied to the line rather than the displayed value, so I have removed it.

 

 

 

Also, if there is a better way to create the margin between the first plotted point and y-axis and last plotted point and right side of chart, let me know. Currently adding empty values and 2 non-displaying series as a hack to achieve this.

 

 

 

Thanks for any help!

post-7332-12844158668_thumb.png

Edited by Guest

Share this post


Link to post
Share on other sites

Hi,

Please find the replies to your queries below:

I have a multi-series line chart and trying to add color (red) formatting for negative values. I am using the displayValue attribute to format my plotted values inside parentheses but can't seem to then get the color attribute to affect that displayed text. Setting the value to red instead changes the color of the line--not the displayed value.

Please try applying "Styles" on the "DATAVALUES" to change the color of the diplayed values.

Ref.- <styles>  

  <definition>

  <style name='Font Style' type='font' size='10' color='FF0000' />

 </definition>

<application>

  <apply toObject='DATAVALUES' styles='Font Style' />

</application>

  </styles>

Also, if there is a better way to create the margin between the first plotted point and y-axis and last plotted point and right side of chart, let me know. Currently adding empty values and 2 non-displaying series as a hack to achieve this.

Could you please try using vertical lines (<vLine> element) in the <categories> element to display the margins on the chart as you intend to?

Ref.- <categories >

<category label='8/6/2006' />

  <vLine color='000000'  linePosition='1'/>

  <category label='8/7/2006' />

</categories>

Please check with the attached screenshot of the rendered chart to get a clear idea of the above explanations.

Hope this helps. :)

post-8143-128441586689_thumb.jpg

Edited by Guest

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