Scale Breaks


Author
Message
Nevron Support
Nevron Support
Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)Supreme Being (4.5K reputation)
Group: Administrators
Posts: 3.1K, Visits: 4.2K
Hi Manal,
The reason for this is that by default the scale break will inflate the range in order to prevent cutting off the data - take a look at this topic:
http://helpdotnetvision.nevron.com/UsersGuide_Axes_Scale_ScaleConfigurator_ScaleBreaks.html

If you want to limit or turn off scale break inflate you need to modify the NAutoScaleBreak class - for example:

NChart chart = nChartControl1.Charts[0];

NDateTimeScaleConfigurator dateTimeScale = new NDateTimeScaleConfigurator();
NAutoScaleBreak autoScaleBreak = new NAutoScaleBreak();

DateTime dt1 = DateTime.Now;
DateTime dt2 = dt1 + TimeSpan.FromDays(1);
double halfDaySapn = (dt2.ToOADate() - dt1.ToOADate()) / 2;

NAbsoluteScaleBreakInflate scaleBreakInflate = new NAbsoluteScaleBreakInflate();
scaleBreakInflate.LeftInflate = halfDaySapn;
scaleBreakInflate.RightInflate = halfDaySapn;
autoScaleBreak.Inflate = scaleBreakInflate;

dateTimeScale.ScaleBreaks.Add(autoScaleBreak);
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = dateTimeScale;

chart.BoundsMode = Nevron.GraphicsCore.BoundsMode.Stretch;

NLineSeries line = new NLineSeries();
line.UseXValues = true;
line.DataLabelStyle.Visible = false;

line.XValues.Add(DateTime.Now);
line.XValues.Add(DateTime.Now + TimeSpan.FromDays(1));
line.Values.Add(10);
line.Values.Add(20);

line.XValues.Add(DateTime.Now + TimeSpan.FromDays(100));
line.XValues.Add(DateTime.Now + TimeSpan.FromDays(101));
line.Values.Add(10);
line.Values.Add(20);

chart.Series.Add(line);

This code shows how to apply a half day inflate around the scale break instead of the relative scale break which is set by default. If you want to remove the inflate completely you can write:

NAutoScaleBreak autoScaleBreak = new NAutoScaleBreak();
autoScaleBreak.Inflate = new NAbsoluteScaleBreakInflate(0);

Let us know if you have any questions or meet any problems.

Best Regards,
Nevron Support Team


Manal Goyal
Manal Goyal
Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)Forum Member (44 reputation)
Group: Forum Members
Posts: 29, Visits: 405
I am trying to apply automatic scale breaks into my charts. I have few questions like, why there is this useless piece of chart still showing me around the breaks,(see the image for your reference).
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...




Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search