How to position the legend in the botton of chart and make 2 column foreach tag?
- Benigno Ranilla asked 5 years ago
- Hi Benigno. Can you clarify your requirements because it isn’t not clear what you’re trying to achieve ( you said that you need to place legend at the bottom of chart but on image which you posted legend is placed on top )? Also can you explain what ‘make 2 column foreach tag’ means? Thanks in advance.
- Add a new image to how I want it to be displayed. Thank you
- You must login to post comments
Hi Benigno,
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);
Best regards,
Yura
- Yura Khariton answered 5 years ago
- You must login to post comments
Hi Yura, I add the image I want to get to with the caption below and the items one after the other.
- Benigno Ranilla answered 5 years ago
- You must login to post comments
Please login first to submit.