AxisScaling Class

Represents the scaling options of the axis.

ExpandedInheritance Hierarchy

SystemObject
  Aspose.Words.Drawing.ChartsAxisScaling

Namespace:  Aspose.Words.Drawing.Charts
Assembly:  Aspose.Words (in Aspose.Words.dll) Version: 22.1.0

ExpandedSyntax

public class AxisScaling

The AxisScaling type exposes the following members.

ExpandedConstructors

  NameDescription
Public methodAxisScaling
Initializes a new instance of the AxisScaling class

ExpandedProperties

  NameDescription
Public propertyCode exampleLogBase
Gets or sets the logarithmic base for a logarithmic axis.
Public propertyCode exampleMaximum
Gets or sets the maximum value of the axis.
Public propertyCode exampleMinimum
Gets or sets minimum value of the axis.
Public propertyCode exampleType
Gets or sets scaling type of the axis.

ExpandedMethods

  NameDescription
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)

ExpandedExamples

Shows how to apply logarithmic scaling to a chart axis.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

Shape chartShape = builder.InsertChart(ChartType.Scatter, 450, 300);
Chart chart = chartShape.Chart;

// Clear the chart's demo data series to start with a clean chart.
chart.Series.Clear();

// Insert a series with X/Y coordinates for five points.
chart.Series.Add("Series 1", 
    new[] { 1.0, 2.0, 3.0, 4.0, 5.0 }, 
    new[] { 1.0, 20.0, 400.0, 8000.0, 160000.0 });

// The scaling of the X-axis is linear by default,
// displaying evenly incrementing values that cover our X-value range (0, 1, 2, 3...).
// A linear axis is not ideal for our Y-values
// since the points with the smaller Y-values will be harder to read.
// A logarithmic scaling with a base of 20 (1, 20, 400, 8000...)
// will spread the plotted points, allowing us to read their values on the chart more easily.
chart.AxisY.Scaling.Type = AxisScaleType.Logarithmic;
chart.AxisY.Scaling.LogBase = 20;

doc.Save(ArtifactsDir + "Charts.AxisScaling.docx");

ExpandedSee Also