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
chartNCartesian
Chart chart = (NCartesian
Chart)n
ChartControl1.
Charts[0];
chart.Axis(StandardAxis.Depth).Visible = false;
chart.SetPredefined
ChartStyle(Predefined
ChartStyle.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
seriesNFloatBar
Series floatBar = (NFloatBar
Series)
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