Hide YAxies

0 Answers 18 Views
Chart
Djordje
Top achievements
Rank 1
Djordje asked on 30 Nov 2023, 02:59 PM

I want to hide YAxies when LineSeries is not showing.I have checkBoxes to show and hide LineSeries and property  bool IsLineSeriesVisible.

<telerik:LineSeries ItemsSource="{Binding data, Mode=OneWay}" CategoryBinding="time" ValueBinding="value" >
                        <telerik:LineSeries.VerticalAxis>
                            <telerik:LinearAxis x:Name="yaxis" HorizontalLocation="Right" Title="{global:LocalizeKey TitleResKey, Default='value'}">
                                <telerik:LinearAxis.Style>
                                    <Style TargetType="telerik:LinearAxis">
                                        <Style.Triggers>
                                            <DataTrigger Binding="{Binding IsLineSeriesVisible}" Value="False">
                                                <Setter Property="Visibility" Value="Collapsed" />
                                            </DataTrigger>
                                        </Style.Triggers>
                                    </Style>
                                </telerik:LinearAxis.Style>
                            </telerik:LinearAxis>
                        </telerik:LineSeries.VerticalAxis>
                    </telerik:LineSeries>

And this is my xaml, dataTrigger is not working when i remove trigger it hiddes yAxis but when i try to add trigger to hide axies when series is not showing it doesn`t do anything

Dinko
Telerik team
commented on 05 Dec 2023, 10:24 AM

Hello Djordje,

I tested the provided code snippet, and it is working fine on my side. I attached a sample solution where this behavior is implemented, and you could take a look.

No answers yet. Maybe you can help?

Tags
Chart
Asked by
Djordje
Top achievements
Rank 1
Share this question
or