AxisBound Class
Represents minimum or maximum bound of axis values.
Inheritance Hierarchy
SystemObject
  Aspose.Words.Drawing.ChartsAxisBound

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

The AxisBound type exposes the following members.

Constructors
  NameDescription
Public methodCode exampleAxisBound
Creates a new instance indicating that axis bound should be determined automatically by a word-processing application.
Public methodCode exampleAxisBound(DateTime)
Creates an axis bound represented as datetime value.
Public methodCode exampleAxisBound(Double)
Creates an axis bound represented as a number.
Properties
  NameDescription
Public propertyCode exampleIsAuto
Returns a flag indicating that axis bound should be determined automatically.
Public propertyCode exampleValue
Returns numeric value of axis bound.
Public propertyCode exampleValueAsDate
Returns value of axis bound represented as datetime.
Methods
  NameDescription
Public methodEquals
Determines whether the specified object is equal in value to the current object.
(Overrides ObjectEquals(Object).)
Public methodGetHashCode
Serves as a hash function for this type.
(Overrides ObjectGetHashCode.)
Public methodGetType (Inherited from Object.)
Public methodToString
Returns a user-friendly string that displays the value of this object.
(Overrides ObjectToString.)
Remarks

Bound can be specified as a numeric, datetime or a special "auto" value.

The instances of this class are immutable.

Examples
Shows how to insert chart with date/time values
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

// Insert chart.
Shape shape = builder.InsertChart(ChartType.Line, 432, 252);
Chart chart = shape.Chart;

// Clear demo data
chart.Series.Clear();

// Fill data
chart.Series.Add("Aspose Test Series",
    new[]
    {
        new DateTime(2017, 11, 06), new DateTime(2017, 11, 09), new DateTime(2017, 11, 15),
        new DateTime(2017, 11, 21), new DateTime(2017, 11, 25), new DateTime(2017, 11, 29)
    },
    new[] { 1.2, 0.3, 2.1, 2.9, 4.2, 5.3 });

ChartAxis xAxis = chart.AxisX;
ChartAxis yAxis = chart.AxisY;

// Set X axis bounds
xAxis.Scaling.Minimum = new AxisBound(new DateTime(2017, 11, 05).ToOADate());
xAxis.Scaling.Maximum = new AxisBound(new DateTime(2017, 12, 03));

// Set major units to a week and minor units to a day
xAxis.BaseTimeUnit = AxisTimeUnit.Days;
xAxis.MajorUnit = 7;
xAxis.MinorUnit = 1;
xAxis.MajorTickMark = AxisTickMark.Cross;
xAxis.MinorTickMark = AxisTickMark.Outside;

// Define Y axis properties
yAxis.TickLabelPosition = AxisTickLabelPosition.High;
yAxis.MajorUnit = 100;
yAxis.MinorUnit = 50;
yAxis.DisplayUnit.Unit = AxisBuiltInUnit.Hundreds;
yAxis.Scaling.Minimum = new AxisBound(100);
yAxis.Scaling.Maximum = new AxisBound(700);

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