We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Stacked Bar Chart - two adjustments


Hello,

I need to adjust a couple of things on the chart above and I'm out of ideas.

First of all - I want the values to be displayed on markers as well as on axis labels converter into percentage. I've tried using the LabelContent property in ChartDataMarker however it does something weird with the numbers --> instead of -0.43 & -0.22 it displays minus infinity % & instead of 0.04 & 0.15 it displays 20.66% & 79.34% so what it does - it gives a percentage value of the element against series total & what I want is simply convert the doubles to percentage display. However I can't seem to find a proper place to attach the converter. This should change the labels display on axis as well.

Second thing - the transition point between the two series on the stacked bar is always at 0.00 - I need to change it into a specified value & what's more - display a marker with that value somewhere on the bar where it is supposed to be.

So the final output would be like that:

percentage values on axis labels
percentage values on data markers
stacked bar red from - 0.43 to X; green from X to +0.04; X value displayed in a marker on X position on a bar in a specified color.

Is it possible? 

Regards,
Michał

6 Replies

MS Michal Staszewski April 3, 2017 04:40 PM UTC

up ^


PS Parthiban Sundaram Syncfusion Team April 5, 2017 03:08 PM UTC

Hi Michal,

Thanks for using Syncfusion products.

We have achieved your requirement using RangeColumnSeries with AxisLabelCreated and DataMarkerLabelCreated(platform specific) events. Please download the sample from following location.

Sample: http://www.syncfusion.com/downloads/support/forum/129746/ze/SimpleSample-545375495  

Please check and let us know if your requirement is different from this.

Regards,
Parthiban S
 



MS Michal Staszewski replied to Parthiban Sundaram April 6, 2017 05:37 PM UTC

Hi Michal,

Thanks for using Syncfusion products.

We have achieved your requirement using RangeColumnSeries with AxisLabelCreated and DataMarkerLabelCreated(platform specific) events. Please download the sample from following location.

Sample: http://www.syncfusion.com/downloads/support/forum/129746/ze/SimpleSample-545375495  

Please check and let us know if your requirement is different from this.

Regards,
Parthiban S
 


that's great. Exactly what I was looking for.

Although... is there a possibility for the chart to display the label for the number in the middle only once? I mean those -22% & -11% which repeat themselves in the middle




PS Parthiban Sundaram Syncfusion Team April 7, 2017 04:01 PM UTC

Hi Michal,

Thanks for the update,

We have modified the sample based on your requirement using the following code snippet. Please download the sample from following location.

Code snippet:
 
  
 
series1.DataMarker.LabelStyle.LabelPosition = DataMarkerLabelPosition.Center;        series2.DataMarker.LabelStyle.LabelPosition = DataMarkerLabelPosition.Center; 
 
 
Please let us know, if you need further assistance on this.

Regards,
Parthiban S
 



MS Michal Staszewski replied to Parthiban Sundaram April 7, 2017 06:24 PM UTC

Hi Michal,

Thanks for the update,

We have modified the sample based on your requirement using the following code snippet. Please download the sample from following location.

Code snippet:
 
  
 
series1.DataMarker.LabelStyle.LabelPosition = DataMarkerLabelPosition.Center;        series2.DataMarker.LabelStyle.LabelPosition = DataMarkerLabelPosition.Center; 
 
 
Please let us know, if you need further assistance on this.

Regards,
Parthiban S
 


yeah, that's what I invented myself. But it's a bit of a cheat-around because those two labels are still over there in the middle, just on top of each other :)


SP Saravana Pandian Murugan Syncfusion Team April 10, 2017 12:27 PM UTC

Hi Michal,

Thanks for the update.

Currently this is the most efficient way to achieve this requirement. Please get back to us if you are facing any issues with this.

Regards,
Saravana Pandian M.


Loader.
Up arrow icon