As you can see in my screen capture, the name is not showing in the legend of the pie chart.
Here is the code :
setup.NomSetup contain the string name
Here is the code :
setup.NomSetup contain the string name
var serie = new PieSeries()
{
ShowLabels = true,
RadiusFactor = 0.9f,
Range = new Telerik.Charting.AngleRange(270, 360)
};
foreach(var setup in setups){
serie.DataPoints.Add(new PieDataPoint(Convert.ToDouble(setup.SommeUseTime * 100 / timeclocks.First().SommeTempsStd), setup.nomsetup)
{
Name = "Test"
});
}
pieChart.Series.Clear();
pieChart.Series.Add(serie);
pieChart.ShowLegend = true;
4 Answers, 1 is accepted
0
Hi Vincent,
Thank you for writing.
I have used the following code with our latest version and the labels are shown as expected on my end.
You can see the result in the attached image.
Since the code is pretty much the same, my guess is that the setup.nomsetup variable does not return a non-empty string. Can you please check that?
Regards,
Stefan
Telerik
Thank you for writing.
I have used the following code with our latest version and the labels are shown as expected on my end.
RadChartView pieChart =
new
RadChartView();
this
.Controls.Add(pieChart);
var serie =
new
PieSeries()
{
ShowLabels =
true
,
RadiusFactor = 0.9f,
Range =
new
Telerik.Charting.AngleRange(270, 360)
};
for
(
int
i = 0; i < 5; i++)
{
serie.DataPoints.Add(
new
PieDataPoint(Math.PI * i,
"Slice "
+ i)
{
Name =
"Test"
});
}
pieChart.Series.Clear();
pieChart.AreaType = ChartAreaType.Pie;
pieChart.Series.Add(serie);
pieChart.ShowLegend =
true
;
You can see the result in the attached image.
Since the code is pretty much the same, my guess is that the setup.nomsetup variable does not return a non-empty string. Can you please check that?
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Vincent
Top achievements
Rank 1
answered on 04 Mar 2015, 02:01 PM
Hi,
This is the chart I get if I use your part of the following code :
Please see the attached files... it's still not working.
This is the chart I get if I use your part of the following code :
int i = 0;
foreach(var setup in setups){
i++;
serie.DataPoints.Add(new PieDataPoint(Math.PI * i, "Slice " + i)
{
Name = "Test"
});
}
Please see the attached files... it's still not working.
0
Accepted
Hi Vincent,
Thank you for the clarification.
We had an issue causing this behavior, and this issue is already resolved in our latest version. I have tested with it, hence I did not observe the same behavior as you. Feel free to upgrade to our latest version in order to benefit from the fix.
If you are unable to upgrade, on the issue page we do have a workaround provided: http://feedback.telerik.com/Project/154/Feedback/Details/121076-fix-radchartview-pieseries-do-not-show-the-legend-properly-the-values-are-not.
I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
Regards,
Stefan
Telerik
Thank you for the clarification.
We had an issue causing this behavior, and this issue is already resolved in our latest version. I have tested with it, hence I did not observe the same behavior as you. Feel free to upgrade to our latest version in order to benefit from the fix.
If you are unable to upgrade, on the issue page we do have a workaround provided: http://feedback.telerik.com/Project/154/Feedback/Details/121076-fix-radchartview-pieseries-do-not-show-the-legend-properly-the-values-are-not.
I hope that you find this information useful. Should you have any other questions, do not hesitate to contact us.
Regards,
Stefan
Telerik
Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.
0
Vincent
Top achievements
Rank 1
answered on 09 Mar 2015, 03:51 PM
The update did the fix, thanks for the support!