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

Problem with Scale Breaks

1 Answer 43 Views
Chart (Obsolete)
This is a migrated thread and some comments may be shown as answers.
Vish
Top achievements
Rank 1
Vish asked on 13 Aug 2008, 02:58 PM
Hi,
I have both positive and negative values in Y-Axis of my graph. When I try to put scale breaks to the negative value bars,it appears but at the same time positive value bars are not visible.

I have made scale breaks enabled true, autoscale of Y axis false, and adding segments. You can see the code below

RadChart3.PlotArea.YAxis.ScaleBreaks.Enabled = true;
        RadChart3.PlotArea.YAxis.ScaleBreaks.Line.Color = System.Drawing.Color.Red;
        RadChart3.PlotArea.YAxis.ScaleBreaks.LineStyle = Telerik.Charting.ScaleBreakLineType.Sinusoid;
Telerik.Charting.AxisSegment seg1 = new Telerik.Charting.AxisSegment();
            seg1.MinValue = -20;
            seg1.MaxValue = 0;
            seg1.Step = 5;

            Telerik.Charting.AxisSegment seg2 = new Telerik.Charting.AxisSegment();
            seg2.MinValue = -100;
            seg2.MaxValue = -80;
            seg2.Step = 5;
        RadChart3.PlotArea.YAxis.ScaleBreaks.Segments.AddRange(new Telerik.Charting.AxisSegment[] { seg1, seg2 });
RadChart3.PlotArea.YAxis.VisibleValues = Telerik.Charting.Styles.ChartAxisVisibleValues.All;



Regards
Vishwanath

1 Answer, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 15 Aug 2008, 09:53 AM
Hello Vishwanath,

The reason for the disappearing positive values is in the segments added to Y axis -- there is no segment that covers the positive values: seg1 = [-20; 0]; seg2 = [-100; -80]. You simply need to define the first segment like this:

        Telerik.Charting.AxisSegment seg1 = new Telerik.Charting.AxisSegment();
        seg1.MinValue = -20;
        seg1.MaxValue = 20;
        seg1.Step = 5;

Hope this helps.

Best regards,
Ves
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Chart (Obsolete)
Asked by
Vish
Top achievements
Rank 1
Answers by
Ves
Telerik team
Share this question
or