SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components
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.
How to position the legend in the botton of chart and make 2 column foreach tag?
I’m afraid it isn’t possible to achieve desired look of the legend at this moment because our legend implementation is based on LinearLayout and it doesn’t support wrapping of its children.
Regarding the placement the legend outside chart ( like on picture where legend is below chart ) – it was very hard to achieve in v2.0 but we’ve added native support for this case in v2.1 ( it isn’t released yet but you can get it from our Maven repository where we publish nightly builds ).
In v2.1 you’ll need to declare SciChartLegend somewhere in your layout ( e.g. below the chart ):
<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.SciChartSurface android:id="@+id/chart" android:layout_width="match_parent" android:layout_height="match_parent"/> <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>
And then just need to pass that legend instance into LegendModifier via constructor:
LegendModifier legendModifier = new LegendModifier(legend);
Please login first to submit.