Manish Kumar
Top achievements
Rank 1
Manish Kumar
asked on 18 Nov 2010, 12:02 PM
Hi
Is there any way where in we can display for the last occuring chartarea datapoint itemlabel as the chart legend name of the LineChart.
thanks
Manish Kumar
Is there any way where in we can display for the last occuring chartarea datapoint itemlabel as the chart legend name of the LineChart.
thanks
Manish Kumar
4 Answers, 1 is accepted
0
Hi Manish Kumar,
Evgeni "Zammy" Petrov
the Telerik team
Can you please provide more details about your scenario. A screenshot with the expected result would be helpful. Thank you.
Sincerely,Evgeni "Zammy" Petrov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight
0
Manish Kumar
Top achievements
Rank 1
answered on 24 Nov 2010, 02:26 PM
Hi
I have attached a dummy screen to give an idea of how the chart should look like afer giving the legend name at the end of the series.
thanks
Manish Kumar
I have attached a dummy screen to give an idea of how the chart should look like afer giving the legend name at the end of the series.
thanks
Manish Kumar
0
Manish Kumar
Top achievements
Rank 1
answered on 24 Nov 2010, 02:29 PM
Hi
I have attached a dummy screen to give an idea of how the chart should look like afer giving the legend name at the end of the series.
thanks
Manish Kumar
I have attached a dummy screen to give an idea of how the chart should look like afer giving the legend name at the end of the series.
thanks
Manish Kumar
0
Hi Manish Kumar,
Hope this is going to help you out. Best wishes,
Evgeni "Zammy" Petrov
the Telerik team
This is not supported out-of-the-box by the chart but there is a easy solution to this. You need to subscribe to DataBound and manually put the Label information for the last DataPoint in LegendItem.
Here is code snippet:
...
RC1.DataBound +=
new
EventHandler<ChartDataBoundEventArgs>(RC1_DataBound);
}
void
RC1_DataBound(
object
sender, ChartDataBoundEventArgs e)
{
DataSeriesCollection dataSeriesCollection = RC1.DefaultView.ChartArea.DataSeries;
for
(
int
i = 0; i < dataSeriesCollection.Count; i++)
{
DataSeries dataSeries = dataSeriesCollection[i];
DataPoint lastDataPointInSeries = dataSeries.Last<DataPoint>();
var legendItem = (RC1.DefaultView.ChartLegend
as
ItemsControl).Items[i]
as
ChartLegendItem;
legendItem.Label = lastDataPointInSeries.Label;
}
}
Hope this is going to help you out. Best wishes,
Evgeni "Zammy" Petrov
the Telerik team
Browse the videos here>> to help you get started with RadControls for Silverlight