RadLegendView doesn't work with Pie Chart

8 posts, 0 answers
  1. Anil
    Anil avatar
    1 posts
    Member since:
    Mar 2014

    Posted 03 May 2014 Link to this post

    Helllo,

    I'm trying to add legends alongside my RadPieChartView on my android Fragment.
    but nothing shows up on my fragment. No errors/warnings too.

    Below is my code:

    chartView = (RadPieChartView) rootView.findViewById(R.id.income_piechart);


    PieSeries pieSeries = new PieSeries(getActivity().getBaseContext());
    pieSeries.setValueBinding(new DataPointBinding() {
    @Override
    public Object getValue(Object o) throws IllegalArgumentException {
    return ((PieChartData) o).value;
    }
    });
    pieSeries.setData(data); 
    pieSeries.setShowLabels(true);
    CustomLabelRenderer renderer = new CustomLabelRenderer(pieSeries);
            pieSeries.setLabelRenderer(renderer);

    chartView.getSeries().add(pieSeries);

    RadLegendView legend = (RadLegendView) rootView.findViewById(R.id.income_legend);
    legend.setLegendProvider(chartView);




  2. Antony Jekov
    Admin
    Antony Jekov avatar
    88 posts

    Posted 07 May 2014 Link to this post

    Hello Anil,

    Thank you for contacting us.

    The public beta version of the chart does not currently support the legend view for pie charts. This is something that we have reviewed and it is yet to be implemented. It will be implemented in the next official release in June this year.

    Thank you for your time and for your feedback!

    Regards,
    Antony Jekov
    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.

     
  3. DevCraft banner
  4. Gill
    Gill avatar
    1 posts
    Member since:
    May 2015

    Posted 02 Jun 2015 Link to this post

    Hi Has this been fixed yet?
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 05 Jun 2015 Link to this post

    Hello Gill,

    Yes, the legend now works with the chart.

    Regards,
    Victor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  6. George
    George avatar
    2 posts
    Member since:
    Jul 2015

    Posted 06 Jul 2015 Link to this post

    This is something that we have reviewed and it is yet to be implemented.
  7. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 06 Jul 2015 Link to this post

    Hi George,

    Thanks for writing.
    Can you please explain what you mean by "it is yet to be implemented.". I tested the pie chart and it worked with the legend as expected. Is there a specific feature that you need?

    Regards,
    Victor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  8. Margarita
    Margarita avatar
    1 posts
    Member since:
    Jan 2015

    Posted 11 Jul 2015 in reply to Victor Link to this post

    Hey Victor,

     

    We also cannot get it to work.

    Is it really implemented?

    Can you send a working sample please?

    Thanks,

    Eric

  9. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 16 Jul 2015 Link to this post

    Hi Margarita,

    Please consider this example:

    RadPieChartView pie = new RadPieChartView(this);
    PieSeries pieSeries = new PieSeries();
    pieSeries.setValueBinding(new PropertyNameDataPointBinding("Value"));
    pieSeries.setData(MainViewModel.GetSimpleData(5));
    pie.getSeries().add(pieSeries);
    RadLegendView legend = new RadLegendView(this);
    legend.setLegendProvider(pie);
    root.addView(pie);
    root.addView(legend);

    Please see the attachment for the screenshot of the result.


    Regards,
    Victor
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top
DevCraft banner