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

Legend checkbox disable

I have a Chart that have two LineSeries. The first serie(aperturas) is Visibility="Visible" and the second(bajas) is Visibility="Collapsed". when the chart is showed, the first is visible and second is collapsed, it is Ok, but in the legend, I have two Chechkbox and the two checkbox are checked. it is a problem, because in the chart only is showed one serie and to show the second serie, I have to check checkbox to descheck and check again to show the content.

<chart:SfChart Grid.Row="3" >
                                <chart:SfChart.Header>
                                    <TextBlock FontSize="14" Text="Días Apertura Campanya" Margin="10" />
                                </chart:SfChart.Header>
                                <chart:SfChart.PrimaryAxis>
                                    <chart:CategoryAxis Header="Días" FontSize="14" LabelFormat="dd/MM/yy" LabelRotationAngle="45" />
                                </chart:SfChart.PrimaryAxis>
                                <chart:SfChart.SecondaryAxis>
                                    <chart:NumericalAxis Header="Aperturas" FontSize="14" Minimum="0" />
                                </chart:SfChart.SecondaryAxis>
                                <chart:SfChart.Legend>
                                    <chart:ChartLegend CheckBoxVisibility="Visible"   />
                                </chart:SfChart.Legend>
                                <chart:LineSeries 
                                    ItemsSource="{Binding Path=DatosAperturasDias}" 
                                    XBindingPath="Key" YBindingPath="Value"
                                    ShowTooltip="True"  Interior="Gold"  
                                    ShowEmptyPoints="True"  EmptyPointValue="Zero"
                                    Label="Aperturas"
                                    VisibilityOnLegend="Visible" Visibility="Visible"
                                    >
                                </chart:LineSeries>
                                <chart:LineSeries 
                                    ItemsSource="{Binding Path=DatosBajasDias}" 
                                    XBindingPath="Key" YBindingPath="Value"
                                    ShowTooltip="True"  Interior="Green"         
                                    ShowEmptyPoints="True"  EmptyPointValue="Zero"
                                    Label="Bajas"
                                    VisibilityOnLegend="Visible" Visibility="Collapsed"                                    
                                    >
                                </chart:LineSeries>
                            </chart:SfChart>




3 Replies

DA Devi Aruna Maharasi Murugan Syncfusion Team December 2, 2016 11:34 AM UTC

Hi Salva, 
  
Thanks for contacting Syncfusion Support. 
  
We have analyzed the reported query and you can achieve your requirement by using IsSeriesVisible property of series rather than Visibility property as shown in the below code snippet, 
  
 
<chart:LineSeries IsSeriesVisible="True"> 
  
We have prepared a demo sample based on your requirement with the reference of the provided code snippet and it can be downloaded from below link, 
  
  
Regards, 
Devi 
 






SA Salva December 2, 2016 03:12 PM UTC

Hi Devi.

Thanks, it's perfect, 


DA Devi Aruna Maharasi Murugan Syncfusion Team December 5, 2016 11:17 AM UTC

Hi Salva, 
  
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