SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, iOS Chart, Android Chart and JavaScript Chart Components
Hi All
By default legends are being draw on scichart surface. I want to draw them outside the scichart surface because as the number of render-able series increase legends hides them. Please give me suggestion how do i do it ?
Hi there,
Well since v2.1 release it pretty simple to do:
You declare SciChartLegend somewhere in layout where you want to place legend.
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<com.scichart.charting.visuals.legend.SciChartLegend
android:id="@+id/legend"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_margin="10dp"/>
</LinearLayout>
You create LegendModifier for chart and pass SciChartLegend instance.
final SciChartLegend legend = (SciChartLegend) findViewById(R.id.legend);
ModifierGroup modifierGroup = sciChartBuilder.newModifierGroup()
.withLegendModifier(legend).build()
.build();
That’s all.
Also we have a few examples in our demo application which shows how to do this.
Hope this will help you!
Best regards,
Yura
Hi Yura
I want to draw the legends whenever a new Renderable series is added on surface and it should be disappeared as soon as Renderable series removed from the surface. Legends need to be draw outside the surface so that i can see renderable series properly.
Please login first to submit.