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

Is it possible to have ColumnSeries and LineSeries on the same chart ?

Hi,

I'd like to create a chart that contains some distributions of values over time.
I have, for each month, both period values and cumulated values.
I'd like to create a chart where the user can graphically see both period or cumulated values.
So my idea is to creata a chart where, for each time period, and for each distribution (series), I can show both a LineSeries for cumulated values or a ColumnSeries (Hystogram) for period values.
I'm wondering if this is possible with your library, since in all your online examples I've always seen only one kind of series type per chart.
I mean a type of chart similar to the one you can see here:

http://www.freshplaza.it/images/2016/0519/MeleCileGrafico01.jpg

Both hystograms or lines ....

Can you help me ?

Thank you,

Silvio Scattaglia

3 Replies

DS Durgadevi Selvaraj Syncfusion Team August 28, 2017 12:50 PM UTC

Hi Silvio, 

Thanks for contacting Syncfusion Support. 

We have analyzed your requirement (showing period value and distribution value in a chart) and achieved by setting multiples series in a chart as shown in the below code, 
MainWindow.xaml: 
 
  <chart:SfChart Margin="10"> 
            
            <chart:SfChart.PrimaryAxis> 
                <chart:CategoryAxis LabelFormat="MMM"/> 
            </chart:SfChart.PrimaryAxis> 
 
            <chart:SfChart.SecondaryAxis> 
                <chart:NumericalAxis Minimum="0" Maximum="200000" Interval="20000"/> 
 
            </chart:SfChart.SecondaryAxis> 
 
            <chart:SfChart.Legend> 
                <chart:ChartLegend /> 
            </chart:SfChart.Legend> 
 
            <chart:ColumnSeries ItemsSource="{Binding Collection}" Label="Period" XBindingPath="XValue" YBindingPath="YValue"/> 
 
 
 
            <chart:LineSeries x:Name="series1" Label="Distribution" ItemsSource="{Binding Collection}" XBindingPath="XValue" YBindingPath="Distribution"> 
                <chart:LineSeries.YAxis > 
                    <chart:NumericalAxis  Minimum="0" Maximum="1200" OpposedPosition="True" Interval="200" ShowGridLines="False"/> 
 
                </chart:LineSeries.YAxis> 
 
            </chart:LineSeries> 
 
        </chart:SfChart> 
                 

Please find the output screenshot, 
 
We have prepared a demo sample based on your requirement and it can be downloaded from below link, 
Sample:LineAndColumn
 

Please let us know if you have any concerns on this. 

Regards, 
Durgadevi S 



SI Silvio August 28, 2017 02:55 PM UTC

Thank you very much for the help !



DS Durgadevi Selvaraj Syncfusion Team August 29, 2017 03:42 AM UTC

Hi Silvio, 
 
Thanks for your response. 
 
Please let us know if you required any further assistance on this. 
 
Regards,   
Durgadevi S 


Loader.
Live Chat Icon For mobile
Up arrow icon