Hi Brian,
Generally you need to create an axis stripe, const line and a custom value label for this purpose. The following code snippet shows how to do that:
private void UpdateAxisBand(NAxis axis, NRange1DD range)
{
// add a const line showing the range begin value
NAxisConstLine line = new NAxisConstLine();
line.Value = range.Begin;
line.StrokeStyle.Color = Color.DarkRed;
line.StrokeStyle.Width = new NLength(2);
axis.ConstLines.Clear();
axis.ConstLines.Add(line);// add a stripe denoting the range
NAxisStripe stripe = new NAxisStripe();
stripe.SetShowAtWall(ChartWallType.Back, true);
stripe.From = range.Begin;
stripe.To = range.End;
stripe.FillStyle = new NColorFillStyle(Color.FromArgb(125, Color.Orange));
axis.Stripes.Clear();
axis.Stripes.Add(stripe);// add a custom value label
NStandardScaleConfigurator scale = axis.ScaleConfigurator as NStandardScaleConfigurator;
scale.CreateNewLevelForCustomLabels = false;
scale.CustomLabelFitModes = new LabelFitMode[] {};
scale.LabelFitModes = new LabelFitMode[] { };
scale.CustomLabels.Clear();NCustomValueLabel valueLabel = new NCustomValueLabel();
valueLabel.Value = range.Begin;
valueLabel.Text = range.Begin.ToString();
valueLabel.Style.TextStyle.FillStyle = new NColorFillStyle(Color.White);
valueLabel.Style.TextStyle.BackplaneStyle.Visible = true;
valueLabel.Style.TextStyle.BackplaneStyle.FillStyle = new NColorFillStyle(Color.Orange);
scale.CustomLabels.Add(valueLabel);
}Note that I clear the stripe/const line collections in order for the code to be reentrant. Another point of interest are the following lines of code:
scale.CreateNewLevelForCustomLabels = false;
scale.CustomLabelFitModes = new LabelFitMode[] {};
scale.LabelFitModes = new LabelFitMode[] { };
The first one will merge the custom labels with the automatically generated one. The rest will turn of label overlapping resolve (otherwise the control will try to stagger/scale labels when they overlap, which will be common in this case).
Hope this helps - let me know if you meet any problems.
Best regards,
Bob