Since you are new to our chatring control I suggest that you refer to our documentation
and online examples
that I believe will get you started properly.
Onto your questions:
There is an online sample
with source code provided where the chart is populated with data from the Nortwind database. You may also find our topic
helpful for your scenario.
By default the chart series show the YValue as Label for each corresponding chart item. Also by default the YAxis automatically arranges itself according to the data shown. Knowing this what you'll need to do is to convert the YAxis labels to percentage. You can achieve this convertion with the following formula:
Divide the current YAxis value to the total of all Bar Values and append percentage sign.
Please note that this should be done in either BeforeLayout
or PrePaint events since they are thrown before the axis labels are drawn. Here's an example:
void RadChart1_BeforeLayout(object sender, EventArgs e)
for (int i = 0; i <
.Series.Items.Sum(s => s.YValue);
decimal calculatedPercentage = RadChart1.PlotArea.YAxis.Items[i].Value / (decimal)totalOfAllItems;
RadChart1.PlotArea.YAxis.Items[i].TextBlock.Text = calculatedPercentage.ToString("P");
All the best,
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed