Spread Windows Forms 9.0 Product Documentation
AxisId Property (ValueAxis)
Example 


Gets or sets an ID for the axis.
Syntax
'Declaration
 
Public Property AxisId As Integer
'Usage
 
Dim instance As ValueAxis
Dim value As Integer
 
instance.AxisId = value
 
value = instance.AxisId
public int AxisId {get; set;}
Exceptions
ExceptionDescription
System.ArgumentOutOfRangeException value is less than zero.
Remarks
If you want to create multiple axis to show different scales, you can use the AxisId property to match the series to the axis. Use the Location property to place the secondary axis in the plot area.
Example
This example sets the AxisId property.
FarPoint.Win.Chart.LineSeries series0 = new FarPoint.Win.Chart.LineSeries();
series0.YAxisId = 0;
series0.Values.AddRange(new double[] { 22, 24, 23, 25 });

FarPoint.Win.Chart.BarSeries series1 = new FarPoint.Win.Chart.BarSeries();
series1.YAxisId = 1;
series1.Values.AddRange(new double[] { 1000.0, 2000.0, 4000.0, 8000.0 });

FarPoint.Win.Chart.YPlotArea plotArea = new FarPoint.Win.Chart.YPlotArea();
plotArea.YAxes.Add(new FarPoint.Win.Chart.ValueAxis());
plotArea.YAxes[0].AxisId = 0;
plotArea.YAxes[1].AxisId = 1;
plotArea.YAxes[1].Location = FarPoint.Win.Chart.AxisLocation.Far;
plotArea.Series.Add(series1);
plotArea.Series.Add(series0);
FarPoint.Win.Chart.ChartModel model = new FarPoint.Win.Chart.ChartModel();
model.PlotAreas.Add(plotArea);
FarPoint.Win.Spread.Chart.SpreadChart chart = new FarPoint.Win.Spread.Chart.SpreadChart();
chart.Size = new Size(200, 200);
chart.Location = new Point(100, 100);
chart.Model = model;
fpSpread1.Sheets[0].Charts.Add(chart);
Dim series0 As New FarPoint.Win.Chart.LineSeries()
series0.YAxisId = 0
series0.Values.AddRange(New Double() {22, 24, 23, 25})

Dim series1 As New FarPoint.Win.Chart.BarSeries()
series1.YAxisId = 1
series1.Values.AddRange(New Double() {1000.0, 2000.0, 4000.0, 8000.0})

Dim plotArea As New FarPoint.Win.Chart.YPlotArea()
plotArea.YAxes.Add(New FarPoint.Win.Chart.ValueAxis())
plotArea.YAxes(0).AxisId = 0
plotArea.YAxes(1).AxisId = 1
plotArea.YAxes(1).Location = FarPoint.Win.Chart.AxisLocation.Far
plotArea.Series.Add(series1)
plotArea.Series.Add(series0)
Dim model As New FarPoint.Win.Chart.ChartModel()
model.PlotAreas.Add(plotArea)
Dim chart As New FarPoint.Win.Spread.Chart.SpreadChart()
chart.Size = New Size(200, 200)
chart.Location = New Point(100, 100)
chart.Model = model
FpSpread1.Sheets(0).Charts.Add(chart)
Requirements

Target Platforms: Windows 2000 Professional (SP4), Windows 2000 Server, Windows 2003 Server (SP1), Windows Server 2012 R2, Windows 2008, Windows XP (SP2), Windows Vista, Windows 7, Windows 8, Windows 8.1, Windows 10

See Also

Reference

ValueAxis Class
ValueAxis Members

 

 


Copyright © GrapeCity, inc. All rights reserved.