Group: Forum Members
Last Active: 11 Years Ago
Posts: 2,
Visits: 1
|
Hello,
It seems that setting NScaleConfigurator.MajorGridStyle.LineStyle.Pattern property for the "SecondaryY" axis does not work. Changing other properties, like NScaleConfigurator.MajorGridStyle.LineStyle.Color, works as expected. Also, the Pattern property behaves fine for the "PrimaryY" axis.
Is this a bug? Is there a way to make it work?
The following code snippet can be used to reproduce the behavior.
var chart = new NCartesianChart { BoundsMode = BoundsMode.Stretch, Dock = DockStyle.Fill, ContentAlignment = ContentAlignment.MiddleCenter, Margins = new NMarginsL(5, 5, 5, 5) }; nChartControl1.Charts.Add(chart);
chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator = new NRangeTimelineScaleConfigurator { AutoDateTimeUnits = new NDateTimeUnit[] { NDateTimeUnit.Year, NDateTimeUnit.Month } };
chart.Axis(StandardAxis.PrimaryY).Visible = false;
var yAxis = chart.Axis(StandardAxis.SecondaryY); yAxis.Visible = true; yAxis.ScaleConfigurator.MajorGridStyle.LineStyle.Pattern = LinePattern.Dash;
var line = (NLineSeries)chart.Series.Add(SeriesType.Line); line.Values.FillRandom(new Random(), 8); line.DisplayOnAxis(StandardAxis.SecondaryY, true);
Thanks, Mikhail
|
Group: Forum Members
Last Active: Yesterday @ 1:54 AM
Posts: 3,054,
Visits: 4,009
|
Hi Mikhail, The problem in this case is that the primary Y axis grid lines are drawn (they are not affected when you specify that the axis is not visible). To workaround this you also need to disable the primary axis grid lines; chart.Axis( StandardAxis.PrimaryY).ScaleConfigurator.MajorGridStyle.LineStyle.Width = new NLength(0);
Best Regards, Nevron Support Team
|