We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Set the position of a chart series in sfchart

Hi,
I have multiple charts that overlay each other on the same graph and I want to set the position of a certain chart to be on front of the others.
I attached an example graph. In this example I would like the red line(BarVaAvg24H) to be in the first layer and the the other 3 charts will be behind.

Thanks in advanced
Yoav

Attachment: Simulator_Screen_Shot_29_Jun_2017,_12.37.59.png_4de5ed15.zip

5 Replies

SP Saravana Pandian Murugan Syncfusion Team June 30, 2017 11:45 AM UTC

Hi Yoavkamary, 
  
Thanks for using Syncfusion products. 
  
In SfChart, ChartSeries will render based on the order it is added to ChartSeriesCollection. 
  
Regarding “In this example I would like the red line(BarVaAvg24H) to be in the first layer and the other 3 charts will be behind” 
  
For this requirement, you can add the LineSeries (red line) at last in the ChartSeriesCollection as per the code snippet. 
 
Code Example: 
  
 
<chart:SfChart.Series> 
  
      <chart:AreaSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue"/> 
  
      <chart:ColumnSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue"/> 
  
      <chart:LineSeries ItemsSource="{Binding Data}" XBindingPath="XValue" YBindingPath="YValue"/> 
  
</chart:SfChart.Series> 
  
  
Please let us know if you need further assistance on this. 
  
Regards, 
Saravana Pandian M. 



YO yoavkamary July 1, 2017 07:16 PM UTC

Thanks a lot, exactly what I needed.

One more thing,
In the same chart I have attached the screen shot, I would like rain(blue bars) and irrigation(aqua bars) to use only Y axe together and not to have Y axe for each as currently.

Yoav



SP Saravana Pandian Murugan Syncfusion Team July 3, 2017 07:02 AM UTC

Hi Yoavkamary,

You can achieve this requirement by hiding the other axis with the help of IsVisible property of ChartAxis. We have attached a sample for your reference which can be downloaded from the below location.

Sample: http://www.syncfusion.com/downloads/support/forum/131225/ze/HideAxis1729333255

Please check the sample and let us know if your requirement is different from this.

Regards,
Saravana Pandian M.



YO yoavkamary July 3, 2017 08:29 AM UTC

Hi,
This is not the result I want. by setting IsVisible to false just hide the Y axe for this particular chart and not making this chart to use the remaining Y axe in relation with it's values.

For example it you look at the screen shot the rain chart mm range from 0 to 4+ and the irrigation char mm range from 0 to 11. what I need is one Y axe that will range for both of them.

Let me know if you need more 
explanation

Thanks



SP Saravana Pandian Murugan Syncfusion Team July 4, 2017 08:54 AM UTC

Hi YoavKumary,

We have achieved your requirement by using the same YAxis to both the ChartSeries. We have modified the sample which can be downloaded from the below location.

Sample: http://www.syncfusion.com/downloads/support/forum/131225/ze/HideAxis1110186873

Please check the sample and let us know if you need further assistance on this.

Regards,
Saravana Pandian M.


Loader.
Up arrow icon