We’d like to customize the look of our legends. We have 4 legends displaying different data, but right now the only thing we can change is the Theme. Is there any way to customize the legend items, like add some icons, change the point marker shape and size, change the check box icon etc…
P.S.: I’m not a trial user. We have an iOS, Android and WPF licenses purchased.
Hello, Lazar and Sean.
SCIChartLegend is a UICollectionView subclass and SCIChartDefaultLegendItem is a UICollectionViewCell subclass.
So to customize legend items you need:
Subclass SCIDefaultLegendItem (create your own xib customize according to your design assign outlets, just take into account properties and methods you have to override).
Create your legend object:
var legend = new SCIChartLegend();
Then create a legend datasource object (pass your xib name into constructor):
var legendDataSource = new SCILegendDataSource(legend, “YourLegendItem.xib”);
then create SCILegendModifier like this:
var legendModifier = new SCILegendModifier(legend, legendDataSource, true);
Let me know if any of these steps isn’t clear enough.
The thing is that we have 4 separate legends with different data sources, and when we tried creating them with SCILegendModifier the data source was the same for all of the legends. Later we tried just using SCIChartLegend and hooking up the data source and we succeeded displaying 4 different legends with 4 different data sources. I’m not sure what was the problem, but if that problem still persists, using the SCILegendModifier won’t be the solution for our problem. However, I’ll try again with the SCILegendModifier and I’ll let you know what’s up.
Thanks a lot,
Please login first to submit.