Spread Windows Forms 11.0 Product Documentation
Location Property (LegendArea)
Example 


FarPoint.Win.Chart Assembly > FarPoint.Win.Chart Namespace > LegendArea Class : Location Property
Gets or sets the location of the legend area in the control canvas space.
Syntax
'Declaration
 
Public Property Location As PointF
'Usage
 
Dim instance As LegendArea
Dim value As PointF
 
instance.Location = value
 
value = instance.Location
public PointF Location {get; set;}
Exceptions
ExceptionDescription
Value's x or y is less than zero or greater than one.
Remarks
Location is measured in relative units ((0,0) = left upper corner of control, (1,1) = right lower corner of control).
Example
This example sets the location.
FarPoint.Win.Chart.AreaSeries aseries = new FarPoint.Win.Chart.AreaSeries();
aseries.SeriesName = "Series1";
aseries.Values.Add(2);
aseries.Values.Add(4);
aseries.Values.Add(3);
aseries.Values.Add(5);
aseries.AreaFill = new FarPoint.Win.Chart.GradientFill(Color.Azure, Color.Bisque);
FarPoint.Win.Chart.AreaSeries aseries1 = new FarPoint.Win.Chart.AreaSeries();
aseries1.SeriesName = "Series2";
aseries1.Values.Add(1);
aseries1.Values.Add(2);
aseries1.Values.Add(4);
aseries1.Values.Add(8);
aseries1.AreaFill = new FarPoint.Win.Chart.GradientFill(Color.Azure, Color.Bisque);
aseries.AreaBorder = new FarPoint.Win.Chart.SolidLine(Color.Blue);
FarPoint.Win.Chart.YPlotArea plotArea = new FarPoint.Win.Chart.YPlotArea();
plotArea.Location = new PointF(0.2F, 0.2F);
plotArea.Size = new SizeF(0.6F, 0.6F);
plotArea.Series.Add(aseries);
plotArea.Series.Add(aseries1);
FarPoint.Win.Chart.LabelArea Label = new FarPoint.Win.Chart.LabelArea();
Label.Text = "Area Chart";
Label.Location = new PointF(0.5F, 0.02F);
FarPoint.Win.Chart.LegendArea legend = new FarPoint.Win.Chart.LegendArea();
legend.Location = new PointF(0.80F, 0.5F);
FarPoint.Win.Chart.ChartModel model = new FarPoint.Win.Chart.ChartModel();
model.LabelAreas.Add(Label);
model.LegendAreas.Add(legend);
model.PlotAreas.Add(plotArea);
fpChart1.Model = model;
Dim aseries As New FarPoint.Win.Chart.AreaSeries
aseries.SeriesName = "Series1"
aseries.Values.Add(2.0)
aseries.Values.Add(4.0)
aseries.Values.Add(3.0)
aseries.Values.Add(5.0)
aseries.AreaFill = New FarPoint.Win.Chart.GradientFill(Color.Azure, Color.Bisque)


Dim aseries1 As New FarPoint.Win.Chart.AreaSeries
aseries1.SeriesName = "Series2"
aseries1.Values.Add(1.0)
aseries1.Values.Add(2.0)
aseries1.Values.Add(4.0)
aseries1.Values.Add(8.0)
aseries1.AreaFill = New FarPoint.Win.Chart.GradientFill(Color.Azure, Color.Bisque)
aseries.AreaBorder = New FarPoint.Win.Chart.SolidLine(Color.Blue)

Dim plotArea As New FarPoint.Win.Chart.YPlotArea()
plotArea.Location = New PointF(0.2F, 0.2F)
plotArea.Size = New SizeF(0.6F, 0.6F)
plotArea.series.Add(aseries)
plotArea.series.Add(aseries1)

Dim Label As New FarPoint.Win.Chart.LabelArea()
Label.Text = "Area Chart"
Label.Location = New PointF(0.5F, 0.02F)
Label.AlignmentX = 0.5F
Label.AlignmentY = 0.0F

Dim legend As New FarPoint.Win.Chart.LegendArea()
legend.Location = New PointF(0.98F, 0.5F)
legend.AlignmentX = 1.0F
legend.AlignmentY = 0.5F

Dim model As New FarPoint.Win.Chart.ChartModel()
model.LabelAreas.Add(Label)
model.LegendAreas.Add(legend)
model.PlotAreas.Add(plotArea)

FpChart1.Model = model
See Also

Reference

LegendArea Class
LegendArea Members