Hi,
I have a Range Chart that I have configured to show time series data across the x-axis and have applied offsets to the y-axis values to plot data for each machine vertically up the scale.The y-axis scale values are numeric but I am using Custom Labels to replace the numbers with relevant text descriptions.
I cannot get the custom labels to Left Align. The
NStringFormatStyle method I am using in the code below doesn’t appear to have any affect.
Can you please let me know how to left align the custom axis labels?
NChart chart = context.document.Charts[0];
NRangeSeries range = chart.Series[0] as NRangeSeries;
// add custom label to the Y axis
NAxis yAxis = chart.Axis(StandardAxis.PrimaryY);
for (int i=1; i < range.Values.Count; i++)
{
string machineName = (string)range.Labels[i];
NCustomValueLabel valueLabel = new NCustomValueLabel(i, machineName);
if (valueLabel.Text == "Filler")
{
valueLabel.Style.TextStyle.FillStyle = new NColorFillStyle(Color.Red);
valueLabel.Style.TextStyle.BackplaneStyle.Visible = true;
valueLabel.Style.TextStyle.BackplaneStyle.FillStyle = new NColorFillStyle(Color.Yellow);
valueLabel.Style.TextStyle.BackplaneStyle.StandardFrameStyle.Visible = false;
}
valueLabel.Style.TextStyle.FontStyle.Name = "Tahoma";
valueLabel.Style.TextStyle.StringFormatStyle = new NStringFormatStyle(StringFormatType.GenericDefault, HorzAlign.Left, VertAlign.Center);
yAxis.ScaleConfigurator.CustomLabels.Add(valueLabel);
}