[]
A fill effect is when the interior of an object is painted. Two types of fill effects are solid and gradient. A solid fill effect uses a single color and a gradient fill uses two colors and a direction.
The following fill effects are available in the Fill class:
No fill - Uses NoFill class.
Solid Color Fill - Uses SolidFill class.
Gradient fill - Uses GradientFill class.
You can fill elements using the Fill property in the following classes:
Labels (LabelArea object)
Legends (LegendArea object)
Walls (Wall object)
Stripes (Stripe object)
Chart itself(ChartModel object)
!type=note
Note: To set the fill effect for the entire plot area, you can set the Fill property of the wall for the plot area. For example, for a y-plot, use the BackWall property of the YPlotArea class to reference the Wall object and set the Fill property.
The following example sets a fill effect for a bar chart. You can also set the fill effect before or after adding the data points if you set the fill effect for the entire series.
FarPoint.Win.Chart.BarSeries series = new FarPoint.Win.Chart.BarSeries();
series.BarFill = new FarPoint.Win.Chart.SolidFill(Color.Red);
series.Values.Add(2.0);
series.Values.Add(4.0);
series.Values.Add(3.0);
series.Values.Add(5.0);
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(series);
FarPoint.Win.Chart.ChartModel model = new FarPoint.Win.Chart.ChartModel();
model.PlotAreas.Add(plotArea);
fpChart1.Model = model;
Dim series As New FarPoint.Win.Chart.BarSeries()
series.BarFill = New FarPoint.Win.Chart.SolidFill(Color.Red)
series.Values.Add(2.0)
series.Values.Add(4.0)
series.Values.Add(3.0)
series.Values.Add(5.0)
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(series)
Dim model As New FarPoint.Win.Chart.ChartModel()
model.PlotAreas.Add(plotArea)
fpChart1.Model = model
If you set the fill effect for a single data point, then you need to assign the fill effect after you add the data point, so there is a data point to store the fill effect in. For example:
FarPoint.Win.Chart.BarSeries series = new FarPoint.Win.Chart.BarSeries();
series.Values.Add(2.0);
series.Values.Add(4.0);
series.BarFills.Add(new SolidFill(Color.Green));
Dim series As New FarPoint.Win.Chart.BarSeries()
series.Values.Add(2.0)
series.Values.Add(4.0)
series.BarFills.Add(New SolidFill(Color.Green))
You can assign fill effects for lines and markers as well. For example:
FarPoint.Win.Chart.PointSeries series = new FarPoint.Win.Chart.PointSeries();
series.PointFill = new FarPoint.Win.Chart.SolidFill(Color.Lime);
series.PointBorder = new FarPoint.Win.Chart.SolidLine(Color.Red);
series.PointMarker = new FarPoint.Win.Chart.BuiltinMarker(FarPoint.Win.Chart.MarkerShape.Triangle, 10.0f);
series.Values.Add(2.0);
series.Values.Add(4.0);
series.Values.Add(3.0);
series.Values.Add(5.0);
Dim series As New FarPoint.Win.Chart.PointSeries()
series.PointFill = New FarPoint.Win.Chart.SolidFill(Color.Lime)
series.PointBorder = New FarPoint.Win.Chart.SolidLine(Color.Red)
series.PointMarker = New FarPoint.Win.Chart.BuiltinMarker(FarPoint.Win.Chart.MarkerShape.Triangle, 10.0F)
series.Values.Add(2.0)
series.Values.Add(4.0)
series.Values.Add(3.0)
series.Values.Add(5.0)
Run the Chart Designer.
Expand the target Plot Area from the tree menu on the left.
Select Bar Chart Series and set BarFill or BarFills in the Appearance section in the property list on the right.
Click OK and close the Chart Designer.
!type=note
Note: For information on starting Chart Designer, refer to Chart Designer in the SPREAD Designer Guide.