stacked column chart intesect some series

Hi,

I Am facing a problem with the stacked colunm chart,

Image_9907_1701592538858

below is an snippet of two columns

 <chart:SfChart.Series>
     <chart:StackingColumnSeries x:Name="series1" EnableAnimation="True" EnableTooltip="true" CornerRadius="1" ItemsSource="{Binding ChartCommandLivreByClient }" Label="Livré" LegendIcon="SeriesType" Spacing="5" XBindingPath="client" YBindingPath="count" Color="#1d9c0c">
         <chart:StackingColumnSeries.TooltipTemplate>
             <DataTemplate>
                 <StackLayout Orientation="Horizontal">
                     <Label Text="{Binding etatCommande.EtatCommande, StringFormat='{0} :'}" />
                     <Label Text="{Binding count}" />
                 </StackLayout>
             </DataTemplate>
         </chart:StackingColumnSeries.TooltipTemplate>
     </chart:StackingColumnSeries>
     <chart:StackingColumnSeries x:Name="series2" EnableAnimation="True" EnableTooltip="true" CornerRadius="1" ItemsSource="{Binding CommandEtatEnExpeditionByClient}" Label="En exped" LegendIcon="SeriesType" Spacing="3" XBindingPath="client" YBindingPath="count" Color="YellowGreen">
         <chart:StackingColumnSeries.TooltipTemplate>
             <DataTemplate>
                 <StackLayout Orientation="Horizontal">
                 <Label Text="{Binding etatCommande.EtatCommande, StringFormat='{0} :'}" />
                 <Label Text="{Binding count}" />
                 </StackLayout>
             </DataTemplate>
         </chart:StackingColumnSeries.TooltipTemplate>
     </chart:StackingColumnSeries>

ChartCommandLivreByClient and CommandEtatEnExpeditionByClient are two

ObservableCollection below is the values :

ATLAS BIO COLIX
Livré 0.01 5
En exped 1 0.01
Expedié 0.01 10
Annulé 0.01 1
Rejecté 0.01 0.01
Créé 4 1


How to prevent the merging of data in my chart here in my case : between COLIX and ATLAS BIO ​(for exemple)


Thanks in advance


1 Reply

SS Sowndharya Selladurai Syncfusion Team December 4, 2023 11:08 AM UTC

Hi Anouar,

We would like to let you know that the category axis works based on the data point index. If the index categories are not the same, it will be separated by a comma. and we can handle this behavior with the ArrangeByIndex property.

<chart:SfChart.PrimaryAxis>

 

                <chart:CategoryAxis ArrangeByIndex="False" />

 

</chart:SfChart.PrimaryAxis>

 

<chart:SfChart.Series>

 

<chart:ColumnSeries ItemsSource="{Binding Data1}"  XBindingPath="Country" YBindingPath="Year2016"/>

      

<chart:ColumnSeries ItemsSource="{Binding Data2}"  XBindingPath="Country" YBindingPath="Year2016"/>

 

</chart:SfChart.Series>



Reference link: https://help.syncfusion.com/xamarin/charts/axis#indexed-category-axis


if expected to remove comma refer below guide line document, 

https://support.syncfusion.com/kb/article/13751/how-to-remove-a-comma-from-the-category-axis-labels-in-net-maui-chart-sfcartesianchart 

I hope this helps!  Let us know if it does not meet your requirements.


Regards.

Sowndharya.



Loader.
Up arrow icon