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: 20.4
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
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.DateTimeValues.docx");
See Also