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
close icon

Displaying several charts in one SfChart

Hi,

I'm trying to find a way to merge different SfCharts into one SfChart, between each of the charts there will be a separator that can be move.
 
I'm storing the data points of each SfChart into a xml file so that I could Deserialize the points into the SfChart. (That way I can view each SfChart separately).

How can I accomplish that?
 
Example for reference

Regards,

Dov.

5 Replies

SA Santhiya Arulsamy Syncfusion Team October 27, 2016 11:11 AM UTC

Hi Dov, 
 
Thanks for the update. 
 
We have prepared the sample based on your requirement by using the GridSplitter. Please find the sample from the following location. 
 
 
Also we can use the chart Row/Column definition property to place more than one chart in the single chart area (don’t have splitter support). Please refer to the following UG link for further information. 
 
  
Thanks, 
Santhiya A 
 



DO Dov October 30, 2016 03:04 PM UTC

Thank you, I have follow up questions:

1. The leftmost GridSplitter can be dragged outside the chart (into the yAxis labels), how can I prevent it from passing the yAxis?
2. I'm changing the background of the chart upon click event, when I press the leftmost chart the background changes to all the chart (include the yAxis labels) and about a 1 cm from the bottom of the chart. How can I change the background of the chart itself - FastLineSeries area only. (like the picture I added in the first thread)?
3. yAxis values are not correct for the 3 top charts, I'm not sure why.

Thank you.

Dov.

Attachment: MultipleSfChart_127081_4b66a641.rar


MK Muneesh Kumar G Syncfusion Team October 31, 2016 11:57 AM UTC

Hi Dov,  
  
Query 1:  The leftmost GridSplitter can be dragged outside the chart (into the yAxis labels), how can I prevent it from passing the yAxis?  
 
We can able to prevent a splitter passing over the y axis by setting MinWidth of first ColumnDefinition as per the below code snippet. 
 
Code Snippet [XAML]: 
 
<Grid.ColumnDefinitions> 
<ColumnDefinition Width="300" MinWidth="70"/> 
<ColumnDefinition Width="0.5"/> 
 
Query 2:  I'm changing the background of the chart upon click event, when I press the leftmost chart the background changes to all the chart (include the yAxis labels) and about a 1 cm from the bottom of the chart. How can I change the background of the chart itself - FastLineSeries area only. (like the picture I added in the first thread)? 
 
We can able to achieve your requirement by setting AreaBackground instead of setting Background property as per the below code snippet. 
 
Code Snippet [C#]: 
 
if( ( sfc.Name == chart1.Name ) || ( sfc.Name == chart2.Name ) || ( sfc.Name == chart3.Name ) ) 
{ 
sfc.AreaBackground = Brushes.DarkBlue; 
} 
 
if( sfc.Name != chart1.Name ) 
{ 
chart1.AreaBackground = null; 
} 
 
We have prepared a demo sample based on this and it can be downloaded from below link,   
 
Query 3: yAxis values are not correct for the 3 top charts, I'm not sure why. 
 
We don’t have splitter support in SfChart, so we have used GridSplitter in Grid.ColumnDefinitions. Here each chart have separate y axis for rendering, so we are unable to share single y axis with multiple chart.  
  
Please let us know if you have any queries. 
 
Thanks,  
Muneesh Kumar G  
 



DO Dov November 1, 2016 11:31 AM UTC

Thank you, It's working great.


DA Devi Aruna Maharasi Murugan Syncfusion Team November 1, 2016 12:17 PM UTC

Hi Dov, 
  
Thanks for your update. 
  
Please let us know, if you need any further assistance. 
  
Regards, 
Devi 


Loader.
Live Chat Icon For mobile
Up arrow icon