Profile Picture

How to show the percentage in axis Y?

Posted By Jacky zhang 13 Years Ago
Author
Message
Jacky zhang
Posted 13 Years Ago
View Quick Profile
Junior Member

Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)Junior Member (16 reputation)

Group: Forum Members
Last Active: 10 Years Ago
Posts: 16, Visits: 1

Hi,

How to show the percentage in axis Y?

I have a 3D bar chart and I want to show axis Y value as percentage just like Gallery - XY Scatter Bubble chart.

Can you give a sample code?

thanks again,

-Jacky

 

 



Nevron Support
Posted 13 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi Jacky,

If the values on displayed on the axis are ready for percentage formatting - that is all values are rescaled to the range [0, 1] then you can simply change the formatting to percentage - for example:

NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();
bar.Values.Add(0.1);
bar.Values.Add(0.2);
bar.Values.Add(0.3);
chart.Series.Add(bar);

NLinearScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
scale.LabelValueFormatter = new NNumericValueFormatter("P");

Otherwise you can use the ValueScale property of the scale label style:

NChart chart = nChartControl1.Charts[0];
NBarSeries bar = new NBarSeries();
bar.Values.Add(10);
bar.Values.Add(20);
bar.Values.Add(30);
chart.Series.Add(bar);

NLinearScaleConfigurator scale = chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator as NLinearScaleConfigurator;
scale.LabelStyle.ValueScale = 0.01;
scale.LabelValueFormatter = new NNumericValueFormatter("P");

Hope this helps - let us know if you meet any problems.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic