Profile Picture

Custom DateTimeScaleConfigurator

Posted By N Rezza 14 Years Ago
Author
Message
N Rezza
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 12, Visits: 1
Hi!

I need to configure a scale to display half-month information (there should be 24 labels for one year).
I don't want to use custom labels.
Is it possible to achieve this goal by overriding NDateTimeScaleConfigurator or should I directly program the scale?

Thanks


Nevron Support
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,009

Hi,

You can do that using the CustomTicks mode (in this mode the scale accepts values for custom ticks) - for example:

NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
DateTime dt1 = DateTime.Now;
DateTime dt2 = dt1 + new TimeSpan(1, 0, 0);
NLineSeries line = new NLineSeries();
line.UseXValues =
true;

line.Values.Add(100);
line.Values.Add(120);
line.Values.Add(130);

line.XValues.Add(dt1.ToOADate());
line.XValues.Add(dt2.ToOADate());

chart.Series.Add(line);

NDateTimeScaleConfigurator dtScale = new NDateTimeScaleConfigurator();dtScale.MajorTickMode = MajorTickMode.CustomTicks;
dtScale.CustomMajorTicks.Add(dt1);
dtScale.CustomMajorTicks.Add(dt2);
chart.Axis(
StandardAxis.PrimaryX).ScaleConfigurator = dtScale;



Best Regards,
Nevron Support Team



N Rezza
Posted 14 Years Ago
View Quick Profile
Junior Member

Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)Junior Member (12 reputation)

Group: Forum Members
Last Active: 13 Years Ago
Posts: 12, Visits: 1
Thank you!



Similar Topics


Reading This Topic