Y-Axis (And X-Axis) Label size in Float Bar


Author
Message
Vahid Mesri
Vahid Mesri
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: 11, Visits: 67
Hi,
I've created the attached float bar chart. 

https://www.nevron.com/forum/uploads/images/b41bde85-8b8e-42bf-8eab-8287.png
Y-Axis font size:
The y-axis labels are quite lengthy and I wanted to increase y-axis font, however, I haven't been able to do so.
Moreover I tried to break labels into separate lines but again unfortunately I couldn't find any way to break the lines.
X-Axis font size:
I cannot change the font size for the x-axis even though I have changed all relevant settings Axis -> Scale -> Label Text Style. I would like to keep the size of the chart area as it is but resize the font of the axis. 

It seems that the font sizes are handled automatically for both the y-axis and x-axis hence my settings are overwritten. Can you kindly let me know how I can change the font sizes?

Best Regards,
Vahid


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 Vahid,

The following code shows how to limit the width of the axis labels as well as how to modify the font size of both the X and Y axis labels:

// configure the chart
NCartesianChart chart = (NCartesianChart)nChartControl1.Charts[0];
chart.Axis(StandardAxis.Depth).Visible = false;
chart.SetPredefinedChartStyle(PredefinedChartStyle.HorizontalLeft);

// setup X axis
NOrdinalScaleConfigurator scaleX = chart.Axis(StandardAxis.PrimaryX).ScaleConfigurator as NOrdinalScaleConfigurator;
scaleX.AutoLabels = false;
scaleX.MajorTickMode = MajorTickMode.AutoMaxCount;
scaleX.DisplayDataPointsBetweenTicks = false;

// set range labels with wrapping
NRangeScaleLabelStyle labelStyle = new NRangeScaleLabelStyle();
labelStyle.TickMode = RangeLabelTickMode.None;
labelStyle.MaxWidth = new NLength(100);
labelStyle.WrapText = true;
labelStyle.TextStyle.FontStyle.EmSize = new NLength(12);
scaleX.LabelStyle = labelStyle;

scaleX.Labels.Add("Some Long Label Some Long Label 1");
scaleX.Labels.Add("Some Long Label Some Long Label 2");

// add interlaced stripe to the Y axis
NLinearScaleConfigurator linearScale = (NLinearScaleConfigurator)chart.Axis(StandardAxis.PrimaryY).ScaleConfigurator;
linearScale.LabelStyle.TextStyle.FontStyle.EmSize = new NLength(12);

// create the float bar series
NFloatBarSeries floatBar = (NFloatBarSeries)chart.Series.Add(SeriesType.FloatBar);
floatBar.DataLabelStyle.Visible = false;

// add bars
floatBar.AddDataPoint(new NFloatBarDataPoint(2, 10));
floatBar.AddDataPoint(new NFloatBarDataPoint(5, 16));

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

Best Regards,
Nevron Support Team


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