SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

Answered
1
0

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

Version
2.2.1839
  • You must to post comments
Best Answer
1
0

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
    you should use the ctor which takes legend as a parameter.
  • Nazar
    you can use legend independently from legendModifier and place it wherever you want
  • Lazar Nikolov
    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.
  • Lazar Nikolov
    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.
  • Nazar
    at this point, i would ask you to provide some code, so we can reproduce your issue on our side. Thanks in advance
Showing 1 result
Your Answer

Please first to submit.