Profile Picture

scale Ruler/label/title alignment of custom axis

Posted By Jim Rowe 12 Years Ago
Author
Message
Jim Rowe
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 4, Visits: 1
that did it, thanks

Nevron Support
Posted 12 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 Jim,

You're very close - actually only the SynchronizeRulerOrientation property should be set to false in order to flip the labels on the right side. The following code displays a Y axis similar to the one in the attached chart:

   NChart chart = nChartControl1.Charts[0];
   NAxis axis = chart.Axis(StandardAxis.PrimaryY);

   // set an anchor to the axis that has right orientation
   NDockAxisAnchor anchor = new NDockAxisAnchor();
   anchor.SynchronizeRulerOrientation = false;
   anchor.RulerOrientation = RulerOrientation.Right;
   axis.Anchor = anchor;

   NStandardScaleConfigurator scale = axis.ScaleConfigurator as NStandardScaleConfigurator;

   // hide inner ticks
   scale.InnerMajorTickStyle.Length = new NLength(0);
   scale.InnerMinorTickStyle.Length = new NLength(0);

   scale.MinorTickCount = 1;

   // hide first / last labels
   scale.DisplayFirstLabel = false;
   scale.DisplayLastLabel = false;

   scale.Title.Text = "Inches";
   scale.Title.Angle = new NScaleLabelAngle(ScaleLabelAngleMode.View, 0);
   scale.Title.RulerAlignment = HorzAlign.Right;
   scale.Title.ContentAlignment = ContentAlignment.TopRight;


Hope this helps -let us know if you meet any problems or have any questions.

 



Best Regards,
Nevron Support Team



Jim Rowe
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 4, Visits: 1
Ok, I've edited the previous and reposted the image.
Thanks

Nevron Support
Posted 12 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 Jim,

We're unable to open the attachment - can you try to post it again or drop a short mail to support@nevron.com with it?

Best Regards,
Nevron Support Team



Jim Rowe
Posted 12 Years Ago
View Quick Profile
Forum Newbie

Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)Forum Newbie (4 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 4, Visits: 1
Hi, I've created a new custom axis like so:
NAxis customAxis = ((NCartesianAxisCollection)_chart.Axes).AddCustomAxis(AxisOrientation.Vertical, (AxisDockZone)(i % 2));
And would like to align the vertical scale to the left of the chart (default, correct?), the hash marks and their labels to the right of the ruler and the scale title to the top right of the scale, horizontally.

I've attached a png of how i would like it to look.

I've tried various combinations of the following:

customAxis.Anchor = new NDockAxisAnchor(AxisDockZone.FrontLeft, false, 0, 100);
customAxis.Anchor.RulerOrientation = RulerOrientation.Right;
(customAxis.Anchor as NDockAxisAnchor).SynchronizeRulerOrientation = true;
customAxis.ScaleConfigurator.Title.RulerAlignment = Nevron.HorzAlign.Right;
customAxis.ScaleConfigurator.Title.ContentAlignment = ContentAlignment.TopRight;
(customAxis.ScaleConfigurator as NLinearScaleConfigurator).DisplayFirstLabel = false;
(customAxis.ScaleConfigurator as NLinearScaleConfigurator).DisplayLastLabel = false;
(customAxis.ScaleConfigurator as NLinearScaleConfigurator).LabelStyle.ContentAlignment = ContentAlignment.MiddleRight;
(customAxis.ScaleConfigurator as NLinearScaleConfigurator).LabelStyle.KeepInsideRuler = true;

thanks!

Attachments
Untitled.png (62 views, 17.00 KB)


Similar Topics


Reading This Topic