Dynamic Axes and chart Rows

Hello,

I have a particular scenario regrading a more complex chart. I have a few dozen Fast line  seriers that I want to display in the following way:
Based on the underlying data type, one type will be shown on one set of axes in the bottom row of the chart. This works well, I used a data template for it.
The other data types have to be shown each on a different row and with a different set of axes. The problem is that I cannot bind ChartBase.RowSpan to my data and I found no way to create a dynamic number of rows.
The reason I want them all on a single chart is that I need a common trackball for all of them.
Also, is there a way to bind the series axes visibility to a property on the data?

Thanks,
Emanuel

3 Replies 1 reply marked as answer

YP Yuvaraj Palanisamy Syncfusion Team February 9, 2021 01:24 PM UTC

Hi Emanuel, 
 
Greetings from Syncfusion. 
 
We have analyzed your query and we achieved your requirement “Dynamically add RowDefinition and bind RowSpan & series axis visibility property” with the help of below code example. Please  
 
CodeSnippet[XAML]: 
<chart:ColumnSeries.YAxis> 
        <chart:NumericalAxis x:Name="secondYAxis"   
                             Visibility="{Binding AxisVisibility}" 
                             PlotOffset="10"  
                             OpposedPosition="True"> 
    </chart:NumericalAxis> 
</chart:ColumnSeries.YAxis> 
 
[C#] 
private void Button_Click(object sender, RoutedEventArgs e) 
 { 
     chart.RowDefinitions.Add(new ChartRowDefinition()); 
     SfChart.SetRow(secondYAxis, 1); 
     ChartBase.SetRowSpan(numericalYAxis, (this.DataContext as ViewModel).RowSpan); 
 } 
 
Also, we have attached the sample for your reference. Please find the sample from the below link. 
 
 
Regards,   
Yuvaraj.   


Marked as answer

EM Emanuel February 9, 2021 05:39 PM UTC

Thank you for your fast response.

In the end I derived from SfChart and added the rows, visiblity and rowspan from there (similar to your solution).

Best regards,
Emanuel



YP Yuvaraj Palanisamy Syncfusion Team February 10, 2021 12:54 PM UTC

Hi Emanuel, 
 
Thank you for your update. We are glad to know that solution works at your end.  
 
Regards, 
Yuvaraj

Loader.
Up arrow icon