ActiveReports for .NET 3 Online Help Request technical support
Custom Axes
User Guide > Concepts > Charts > Chart Appearance > Chart Axes and Walls > Custom Axes

Glossary Item Box

The Chart control supports the creation of additional custom axes through the use of the chart's CustomAxes collection.  Once a custom axis has been added to the collection, in addition to setting the normal axis properties, you will need to set the following properties:

The following code sample demonstrates creating a custom axis, adding it to the Axes collection for the ChartArea, and setting its properties.

' Visual Basic 
' create the custom axis and add it to the ChartArea's Axes collection
Dim customAxisY As New DataDynamics.ActiveReports.Chart.CustomAxis
Me.ChartControl1.ChartAreas(0).Axes.Add(customAxisY)

' set the basic axis properties for customAxisY
customAxisY.LabelFont = New DataDynamics.ActiveReports.Chart.FontInfo(Color.Red, New Font _
	("Arial", 7.0!))
customAxisY.LabelsGap = 1
customAxisY.LabelsVisible = True
customAxisY.Line = New DataDynamics.ActiveReports.Chart.Graphics.Line(Color.Red)
customAxisY.MajorTick = New DataDynamics.ActiveReports.Chart.Tick(New DataDynamics _
	.ActiveReports.Chart.Graphics.Line(Color.Red, 1), New DataDynamics.ActiveReports.Chart _
	.Graphics.Line(Color.Red, 1), 1, 2.0F, True)
customAxisY.MajorTick.GridLine = New DataDynamics.ActiveReports.Chart.Graphics.Line(Color _
	.Red, 1, LineStyle.Solid)
customAxisY.MajorTick.Visible = True
customAxisY.Max = 5
customAxisY.MaxDerived = False
customAxisY.Min = 0
customAxisY.Visible = True

' set the special custom axis properties
customAxisY.Parent = ((CType(Me.ChartControl1.ChartAreas(0).Axes("AxisY"), DataDynamics _
	.ActiveReports.Chart.Axis)))
customAxisY.PlacementLength = 20
customAxisY.PlacementLocation = 30

// C#
// create the custom axis and add it to the ChartArea's Axes collection
DataDynamics.ActiveReports.Chart.CustomAxis customAxisY = new DataDynamics.ActiveReports
	.Chart.CustomAxis();
this.chartControl1.ChartAreas[0].Axes.Add(customAxisY);

// set the basic axis properties for customAxisY
customAxisY.LabelFont = new DataDynamics.ActiveReports.Chart.FontInfo(Color.Red, new Font
	("Arial", 7F, FontStyle.Regular, GraphicsUnit.Point, ((System.Byte)(0))));
customAxisY.LabelsGap = 1;
customAxisY.LabelsVisible = true;
customAxisY.Line = new DataDynamics.ActiveReports.Chart.Graphics.Line(Color.Red);
customAxisY.MajorTick = new DataDynamics.ActiveReports.Chart.Tick(new DataDynamics
	.ActiveReports.Chart.Graphics.Line(Color.Red, 1), new DataDynamics.ActiveReports.Chart
	.Graphics.Line(Color.Red, 1), 1, 2F, true);
customAxisY.MajorTick.GridLine = new DataDynamics.ActiveReports.Chart.Graphics.Line(Color
	.Red, 1, LineStyle.Solid);
customAxisY.MajorTick.Visible = true;
customAxisY.Max = 5;
customAxisY.MaxDerived = false;
customAxisY.Min = 0;
customAxisY.Visible = true;

// set the special custom axis properties
customAxisY.Parent = (DataDynamics.ActiveReports.Chart.Axis)this.ChartControl1.ChartAreas[0]
	.Axes["AxisY"];
customAxisY.PlacementLength = 20;
customAxisY.PlacementLocation = 30;

 

©2009. All Rights Reserved.