Profile Picture

How to show the axis ticks and labels correctly when resizing the window

Posted By bargitta chen 13 Years Ago

How to show the axis ticks and labels correctly when resizing the...

Author
Message
Nevron Support
Posted 13 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 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



bargitta chen
Posted 13 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

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?

Nevron Support
Posted 13 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 Barqitta,

How do you configure this scale - can you post the code?



Best Regards,
Nevron Support Team



bargitta chen
explanationmark Posted 13 Years Ago
View Quick Profile
Junior Member

Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)Junior Member (18 reputation)

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.

Attachments
Capture.PNG (58 views, 238.00 KB)


Similar Topics


Reading This Topic