scale Ruler/label/title alignment of custom axis


Author
Message
Jim Rowe
Jim Rowe
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
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 (83 views, 17.00 KB)
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 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
Jim Rowe
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
Posts: 4, Visits: 1
Ok, I've edited the previous and reposted the image.
Thanks
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 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
Jim Rowe
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
Posts: 4, Visits: 1
that did it, thanks
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