This is a migrated thread and some comments may be shown as answers.

Hide negative values line

2 Answers 49 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Gregory Greg
Top achievements
Rank 1
Gregory Greg asked on 05 Dec 2009, 03:11 PM
How do I hide the negative values line (the y-axis zero) introduced with the Q3.2009 version?

Thanks
Greg

2 Answers, 1 is accepted

Sort by
0
Giuseppe
Telerik team
answered on 07 Dec 2009, 03:00 PM
Hello Gregory Greg,

You can achieve the desired effect by modifying the respective PlotArea axis style like this:

XAML
<UserControl x:Class="SilverlightApplication1.MainPage"
    xmlns:controls="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls"
    xmlns:control="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Charting"
    xmlns:chart="clr-namespace:Telerik.Windows.Controls.Charting;assembly=Telerik.Windows.Controls.Charting"
    xmlns:mscorlib="clr-namespace:System;assembly=mscorlib"
 
    <Grid x:Name="LayoutRoot">
        <Grid.Resources>
            <Style x:Name="CustomPlotAreaAxisXStyle" TargetType="chart:AxisX2D">
                <Setter Property="AxisLineStyle">
                    <Setter.Value>
                        <Style TargetType="Line">
                            <Setter Property="Visibility" Value="Collapsed" />
                        </Style>
                    </Setter.Value>
                </Setter>
            </Style>
        </Grid.Resources>
         
        <control:RadChart x:Name="RadChart1" />
 
    </Grid>
 
</UserControl>

C#
RadChart1.DefaultView.ChartArea.PlotAreaAxisXStyle = this.CustomPlotAreaAxisXStyle;
RadChart1.ItemsSource = new int[] { 10, 20, -20, -30, 20 };


Hope this helps.

Kind regards,
Manuel
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Gregory Greg
Top achievements
Rank 1
answered on 07 Dec 2009, 04:36 PM
It works, thanks Manuel.
Greg
Tags
Chart
Asked by
Gregory Greg
Top achievements
Rank 1
Answers by
Giuseppe
Telerik team
Gregory Greg
Top achievements
Rank 1
Share this question
or