ChartAxisMinorUnit Property

Returns or sets the distance between minor tick marks.

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

Syntax

public double MinorUnit { get; set; }

Property Value

Type: Double

Remarks

Valid range of a value is greater than zero. The property has effect for time category and value axes.

Setting this property sets the MinorUnitIsAuto property to false.

Examples

Shows how to insert chart using the axis options for detailed configuration.
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);

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

// Clear demo data.
chart.Series.Clear();
chart.Series.Add("Aspose Test Series",
    new[] { "Word", "PDF", "Excel", "GoogleDocs", "Note" },
    new double[] { 640, 320, 280, 120, 150 });

// Get chart axes
ChartAxis xAxis = chart.AxisX;
ChartAxis yAxis = chart.AxisY;

// For 2D charts like the one we made, the Z axis is null
Assert.Null(chart.AxisZ);

// Set X-axis options
xAxis.CategoryType = AxisCategoryType.Category;
xAxis.Crosses = AxisCrosses.Minimum;
xAxis.ReverseOrder = false;
xAxis.MajorTickMark = AxisTickMark.Inside;
xAxis.MinorTickMark = AxisTickMark.Cross;
xAxis.MajorUnit = 10.0d;
xAxis.MinorUnit = 15.0d;
xAxis.TickLabelOffset = 50;
xAxis.TickLabelPosition = AxisTickLabelPosition.Low;
xAxis.TickLabelSpacingIsAuto = false;
xAxis.TickMarkSpacing = 1;

// Set Y-axis options
yAxis.CategoryType = AxisCategoryType.Automatic;
yAxis.Crosses = AxisCrosses.Maximum;
yAxis.ReverseOrder = true;
yAxis.MajorTickMark = AxisTickMark.Inside;
yAxis.MinorTickMark = AxisTickMark.Cross;
yAxis.MajorUnit = 100.0d;
yAxis.MinorUnit = 20.0d;
yAxis.TickLabelPosition = AxisTickLabelPosition.NextToAxis;

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

See Also