Group: Forum Members
Last Active: 12 Years Ago
Posts: 18,
Visits: 1
|
Dear experts, I have got a problem with the x axis labels and ticks. When I narrow the window size of the bar chart, I find that some x labels and ticks are missing and make the chart incorrect (please refer to the attachment). What I want is the same chart with full ticks and labels but smaller and narrower. Would you please help me do that? Thank you in advance.
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Barqitta, How do you configure this scale - can you post the code?
Best Regards, Nevron Support Team
|
Group: Forum Members
Last Active: 12 Years Ago
Posts: 18,
Visits: 1
|
Dear experts,
Here is my code related to the axis:
//when initialize the bar chart, we do the following block first :
NStandardScaleConfigurator scaleX = _chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NStandardScaleConfigurator; scaleX.RoundToTickMax = true; scaleX.RoundToTickMin = true;
scaleX.OuterMajorTickStyle.Length = new NLength(2, scaleX.OuterMajorTickStyle.Length.MeasurementUnit); scaleX.OuterMinorTickStyle.Visible = false; scaleX.InnerMajorTickStyle.Visible = false; scaleX.InnerMinorTickStyle.Visible = false; scaleX.MinorTickCount = 3;
//we then use the following method to add labels to the x axis public void UpdateXLabelSettings() { if (m_lableGroups.Count > 0) {
NStandardScaleConfigurator scaleConfiguratorX = (NStandardScaleConfigurator)_chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator; scaleConfiguratorX.AutoLabels = false; scaleConfiguratorX.Labels.Clear(); foreach (String label in m_lableGroups) { scaleConfiguratorX.Labels.Add(label);
}
//set wrapped text label style NRangeScaleLabelStyle rangeScaleLabelStyle = new NRangeScaleLabelStyle(); rangeScaleLabelStyle.TickMode = RangeLabelTickMode.None; rangeScaleLabelStyle.WrapText = true; scaleConfiguratorX.LabelStyle = rangeScaleLabelStyle;
} }
But when resizing the chart, the ticks and the scale of the x axis do not work well. Would you please help on that?
|
Group: Forum Members
Last Active: Last Week
Posts: 3,054,
Visits: 4,009
|
Hi Barqitta, Try setting a fixed step: scaleX.MajorTickMode = MajorTickMode.CustomStep; scaleX.CustomStep = 1;That way the scale will aways use step 1 as opposed to dynamically calculated step, which will hide some of the labels.
Best Regards, Nevron Support Team
|