Export (0) Print
Expand All

AxisScaleBreakStyle Class

Represents a scale break on the Y-axis of the chart.

System.Object
  System.Web.UI.DataVisualization.Charting.AxisScaleBreakStyle

Namespace:  System.Web.UI.DataVisualization.Charting
Assembly:  System.Web.DataVisualization (in System.Web.DataVisualization.dll)

public class AxisScaleBreakStyle

The AxisScaleBreakStyle type exposes the following members.

  NameDescription
Public methodAxisScaleBreakStyleInitializes a new instance of the AxisScaleBreakStyle class.
Top

  NameDescription
Public propertyBreakLineStyleGets or sets the style of the break line that will be used to draw the scale break.
Public propertyCollapsibleSpaceThresholdGets or sets the threshold of space on the chart at which scale breaks are drawn.
Public propertyEnabledGets or sets a flag that indicates whether scale breaks are enabled.
Public propertyLineColorGets or sets the color of the scale break line.
Public propertyLineDashStyleGets or sets the style of the scale break line.
Public propertyLineWidthGets or sets the width of the scale break line.
Public propertyMaxNumberOfBreaksGets or sets the maximum number of scale breaks to be displayed on the chart.
Public propertySpacingGets or sets the spacing gap between the lines of the scale break. The spacing gap is represented as a percentage of the Y-axis.
Public propertyStartFromZeroGets or sets a StartFromZero enumeration value that indicates whether to start the scale break from zero.
Top

  NameDescription
Public methodEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Top

Scale breaks are intentional discontinuities on the Y-axis that are most often used to redistribute the data points in a series on a chart. This feature improves readability when there are large differences between the high and low values of the data in one series being plotted. Scale breaks are not drawn for differences between data in multiple series.

By default, scale breaks are disabled. You can enable scale breaks on the Y-axis by setting the Enabled property to true. To change the amount of vertical space of the scale break, you can specify a Spacing value. This is calculated as a percentage of the Y-axis scale.

You must have sufficient separation between ranges of data points in a single series to draw a scale break. By default, a scale break can be added only if there is a separation between the data ranges of at least 25% of the chart. If you enable a scale break but it does not appear, even though there is sufficient distance between the data ranges, you can set the CollapsibleSpaceThreshold property to a value less than 25.

Charts support up to five scale breaks per chart; however, the chart can become unreadable if you display more than one scale break. If you have more than two data ranges, consider using a different method for displaying this data. Use the MaxNumberOfBreaks property to reduce the number of scale breaks that can be displayed on the chart.

When a scale break is used, the Y-axis labels may become offset. To disable the label offset, set the IsStaggered property to false.

Scale breaks are not supported under any of the following conditions:

  • Pie, doughnut, funnel, pyramid, radial or any stacked chart types are used.

  • Custom intervals for labels, tick marks or grid lines are enabled. 

  • The minimum or maximum value for the axis is set.

  • Custom labels are used.

  • A logarithmic Y-axis is specified.

  • Axis views on the Y-axis, which include scrolling and zooming, are used.

  • 3-D charts are used.

The following code example demonstrates how to enable and customize a scale break after the Chart control has been added to the design surface.

using System.Web.UI.DataVisualization.Charting

private void AddChartData()
{
   chart1.Series["Series1"].Points.Add(new DataPoint(1, 2));
   chart1.Series["Series1"].Points.Add(new DataPoint(2, 4));
   chart1.Series["Series1"].Points.Add(new DataPoint(3, 400000));
   chart1.Series["Series1"].Points.Add(new DataPoint(4, 3));
}

private void AddScaleBreaks()
{
   // Enable scale breaks.
   chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Enabled = true;

   // Show scale break if more than 25% of the chart is empty space.
   chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.CollapsibleSpaceThreshold = 25;

   // Set the line width of the scale break.
   chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineWidth = 2;

   // Set the color of the scale break.
   chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.LineColor = Color.Red;

   // If all data points are significantly far from zero, the chart will calculate the scale minimum value.
   chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.StartFromZero = StartFromZero.Auto;

   // Set the spacing gap between the lines of the scale break (as a percentage of the Y-axis).
    chart1.ChartAreas["ChartArea1"].AxisY.ScaleBreakStyle.Spacing = 2;
}

.NET Framework

Supported in: 4.6, 4.5, 4

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft