Scales / Sections
In This Topic
    Sections
    In This Topic

    Scale sections allow you to alter the appearance of different scale elements if they fall in a specified range. This allows you to visually highlight important ranges of data that the user has to pay special attention to.

     Creating a Scale Section

    You create a scale section by creating an instance of the NScaleSection class. The following code will create a scale section:

    C#
    Copy Code
    // create the scale section
    NScaleSection scaleSection = new NScaleSection();
    scaleSection.Range = new NRange(2, 8);
    // display the range on the back wall
    scaleSection.ShowRangeAtBackground = true;
    scaleSection.Fill = new NColorFill(NColor.FromColor(NColor.Red, 0.5f));
    // alter the major and minor grid stroke style if lines fall in the range [2, 8]
    scaleSection.MajorGridStroke= new NStroke(NColor.Red);
    scaleSection.MajorTickStroke = new NStroke(NColor.DarkRed);
    scaleSection.MinorTickStroke = new NStroke(1, NColor.Red, ENDashStyle.DashDot, null);
    // alter the text style of the automatic labels
    NTextStyle labelStyle = new NTextStyle();
    labelStyle.Fill = new NStockGradientFill(NColor.Red, NColor.DarkRed);
    labelStyle.Font.Style = ENFontStyle.Bold;
    scaleSection.LabelTextStyle = labelStyle;