AxisScaling Class
Represents the scaling options of the axis.
Inheritance Hierarchy
SystemObject
  Aspose.Words.Drawing.ChartsAxisScaling

Namespace: Aspose.Words.Drawing.Charts
Assembly: Aspose.Words (in Aspose.Words.dll) Version: 19.12
Syntax
public class AxisScaling

The AxisScaling type exposes the following members.

Constructors
  NameDescription
Public methodAxisScaling
Initializes a new instance of the AxisScaling class
Properties
  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.
Methods
  NameDescription
Public methodEquals (Inherited from Object.)
Protected methodFinalize (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Protected methodMemberwiseClone (Inherited from Object.)
Public methodToString (Inherited from Object.)
Examples
Shows how to set up logarithmic axis scaling.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert a scatter chart and clear its default data series
Shape chartShape = builder.InsertChart(ChartType.Scatter, 450, 300);
Chart chart = chartShape.Chart;
chart.Series.Clear();

// Insert a series with X/Y coordinates for 5 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, which means it will display "0, 1, 2, 3..."
Assert.AreEqual(AxisScaleType.Linear, chart.AxisX.Scaling.Type);

// Linear axis scaling is suitable for our X-values, but not our erratic Y-values 
// We can set the scaling of the Y-axis to Logarithmic with a base of 20
// The Y-axis will now display "1, 20, 400, 8000...", which is ideal for accurate representation of this set of Y-values
chart.AxisY.Scaling.Type = AxisScaleType.Logarithmic;
chart.AxisY.Scaling.LogBase = 20.0;

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