Legend control on RadCartesianChart

6 posts, 0 answers
  1. David
    David avatar
    1 posts
    Member since:
    Oct 2013

    Posted 06 Oct 2013 Link to this post

    Hi,

    I'm writing a Windows Phone 8 app and am using a RadCartesianChart with 2 different LineSeries in it.

    Is it possible to add a legend onto the chart with some text identifying what each LineSeries represents?

    Thanks.

    Dave.
  2. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    551 posts

    Posted 10 Oct 2013 Link to this post

    Hi David,

    Thank you for the question.

    Unfortunately, this version of the chart does not support legend. Still we think that this would be useful feature and I have logged it in our Ideas & Feedback Portal where you and our community can vote for it - the higher the demand, the higher the priority.

    Please, feel free to contact us again should you have any other questions or ideas.

    Regards,
    Rositsa Topchiyska
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  3. DevCraft banner
  4. Nino
    Nino avatar
    19 posts
    Member since:
    Apr 2012

    Posted 29 Dec 2013 Link to this post

    Are there any suggestions how to manually implement a legend to a chart?
  5. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    551 posts

    Posted 02 Jan 2014 Link to this post

    Hello Nino,

    Thank you for the question.

    I have attached a sample application with the simplest possible implementation of a chart legend. If you have more specific requirements, do not hesitate to contact us.

    Regards,
    Rositsa Topchiyska
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
  6. Nino
    Nino avatar
    19 posts
    Member since:
    Apr 2012

    Posted 04 Jan 2014 Link to this post

    Hi Rositsa

    Thanks for your sample project. The only thing missing know is that I can bind the color of the series to the legend. The scenario would be that I have a pie chart and use the color palette. The amount of data is dynamicly bound. So I would need a way to get information out of the series of the chart.



  7. Rosy Topchiyska
    Admin
    Rosy Topchiyska avatar
    551 posts

    Posted 09 Jan 2014 Link to this post

    Hello Nino,

    Thank you for the question.

    I have attached a runnable sample application that demonstrates how to implement a legend for RadPieChart.

    For the legend I use an ItemsControl and set its ItemsSource to the DataPoints collection of the chart Series. Each data point has a DataItem property that is the underlying item from the view model. Via a value converter using the ChartPalette.GetEntry(seriespoint index) method you can get the corresponding palette color for each data point. You will also need to reset the ItemsSource of the legend each time you add/remove point in order to update the legend.

    I hope this should give you a basic idea of how you can implement a legend. Please, do not hesitate to contact us if you have further questions.

    Regards,
    Rositsa Topchiyska
    Telerik
    Have a suggestion or face a problem - you can use the Ideas & Feedback portal to submit ideas, feedback and vote for them.
Back to Top
DevCraft banner