Profile Picture

NDateTimeScaleConfigurator centering labels

Posted By Craig Swearingen 9 Years Ago
Author
Message
Craig Swearingen
Question Posted 9 Years Ago
View Quick Profile
Supreme Being

Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)Supreme Being (97 reputation)

Group: Forum Members
Last Active: 7 Years Ago
Posts: 99, Visits: 654
https://www.nevron.com/forum/uploads/images/dd7edf45-4a57-4b4f-ad6a-8a4d.png
Is what my axes looks like with this code:

    NDateTimeScaleConfigurator dateTimeScale = new NDateTimeScaleConfigurator();
    dateTimeScale.LabelStyle.ContentAlignment = ContentAlignment.TopLeft;
    dateTimeScale.LabelStyle.Offset = new NLength(-7);
    dateTimeScale.LabelValueFormatter = new NDateTimeValueFormatter(" yyyy");
    dateTimeScale.EnableUnitSensitiveFormatting = false;
    dateTimeScale.AutoDateTimeUnits = new NDateTimeUnit[] { NDateTimeUnit.Year };
    dateTimeScale.OuterMajorTickStyle.Length = new NLength(10);
    chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = dateTimeScale;

I would prefer to have my year label centered between the two major ticks instead of justified near the tick.  I've been trying several things but I can't seem to find a way to do this.  Is there another approach where I can center this label?

Nevron Support
This post has been flagged as an answer
Posted 9 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: Yesterday @ 1:54 AM
Posts: 3,054, Visits: 4,009

Hi Craig,
You can use a range timeline scale with hidden second / third rows - it behaves similar to date time scale, but you'll be able to position the titles in the middle by changing the first row data label style ContentAlignment to MiddleCenter.



Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic