PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.57k stars 9.01k forks source link

Legend setCustom error #2918

Open sebastiansharun opened 7 years ago

sebastiansharun commented 7 years ago

I am using MPchart piechart. When i set custom legend arrays it not accepting that array.

My code...

Legend l = chart.getLegend();
l.setCustom(ColorTemplate.VORDIPLOM_COLORS, new String[] { "aaaaa", "bbbbb", "ccccc"});

Error...

Cannot resolve method 'setCustom(int[],java.lang.String[])'

My MPchart version :v3.0.0

Jetz72 commented 7 years ago

Wherever you found instructions to use setCustom like that (presumably the wiki), it's out of date. setCustom is now used with an array or List of LegendEntry objects, which contain details on how to format each entry.

The wiki should probably be updated, and there should have at least been a deprecated method in there that takes the original parameters and wraps the new implementation, but you should be able to change it on your end with no problems. Just read through the JavaDoc on LegendEntry and setCustom for details.