We’re trying to make multiple legends on the screen, for example, 1 for the left axis and its data series, 1 for the right axis and its data series. I can see it’s possible in the WPF documentation, but in the iOS documentation it says “Coming soon!”. Do we need to wait for a future release of the Xamarin.iOS library or is it possible somehow now?
By the way, I’m not a trial user. We’ve just purchased a license today.
Thanks,
Lazar Nikolov
- Lazar Nikolov asked 6 years ago
- last edited 6 years ago
- You must login to post comments
Hell Lazar,
Thanks for writing to us. Sure it’s possible, all you need is to create custom dataSource for your legend and fill if with appropriate seriesInfos. Please see the code below:
// create hitTestInfo to be aboe to get seriesInfo from renderableSeries;
var info = new SCIHitTestInfo();
// assuming that legend1 coming from your xib layout.
// if it's created in code, you need to place it on the view programmatically.
SCIChartLegend legend1;
// create custom dataSource for the above legend.
var dataSource1 = new SCISeriesInfoLegendDataSource(legend1);
// fill dataSet of your dataSourse with seriesInfo's you need.
dataSource1.DataSet.Add(rs1.ToSeriesInfoWithHitTest(info));
dataSource1.DataSet.Add(rs2.ToSeriesInfoWithHitTest(info));
// set custom dataSource to be dataSource of your legend.
legend1.DataSource = dataSource1;
Hope that helps.
Best Regards,
Nazar R.
- Nazar Rudnyk answered 6 years ago
-
you should use the ctor which takes legend as a parameter.
-
you can use legend independently from legendModifier and place it wherever you want
-
How would I do that? I tried wrapping it in a Legend Modifier and adding the legend modifier to the Graph Surface but it didn’t display 4 legends, but 2 legends with the data merged.
-
I tried adding it as a subview to the view, but that didn’t work as well. I’m checking the Frame of the legends, it does have Width and Height and the X and Y coordinates of the view are correct, but it still doesn’t show up.
-
at this point, i would ask you to provide some code, so we can reproduce your issue on our side. Thanks in advance
- 6 more comments
- You must login to post comments
Please login first to submit.