SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & 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.

0
0

How to position the legend in the botton of chart and make 2 column foreach tag?

Version
7.1
  • Yura Khariton
    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.
  • Benigno Ranilla
    Add a new image to how I want it to be displayed. Thank you
  • You must to post comments
0
0

Hi Yura, I add the image I want to get to with the caption below and the items one after the other.

Images
  • You must to post comments
0
0

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

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.