# Fill Effects

Learn how to apply solid and gradient fill effects to your charts using Spread for Windows Forms.

## Content

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](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.Fill.html) class:

* No fill - Uses [NoFill](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.NoFill.html) class.
* Solid Color Fill - Uses [SolidFill](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.SolidFill.html) class.
* Gradient fill - Uses [GradientFill](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.GradientFill.html) class.

You can fill elements using the Fill property in the following classes:

* Labels ([LabelArea](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.LabelArea.html) object)
* Legends ([LegendArea](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.LegendArea.html) object)
* Walls ([Wall](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.Wall.html) object)
* Stripes ([Stripe](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.Stripe.html) object)
* Chart itself([ChartModel](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.ChartModel.html) 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](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.YPlotArea.BackWall.html) property of the [YPlotArea](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.YPlotArea.html) class to reference the [Wall](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.Wall.html) object and set the [Fill](/spreadnet/api/latest/online-win/FarPoint.Win.Chart/FarPoint.Win.Chart.Wall.Fill.html) property.

## Example

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.

```csharp
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;
```

```vbnet
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:

```csharp
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));
```

```vbnet
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:

```csharp
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);
```

```vbnet
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)
```

## Using the Chart Designer

1. Run the **Chart Designer**.
2. Expand the target **Plot Area** from the tree menu on the left.
3. Select **Bar Chart Series** and set **BarFill** or **BarFills** in the **Appearance** section in the property list on the right.
4. Click OK and close the **Chart Designer**.

> !type=note
> **Note:** For information on starting [Chart Designer](/spreadnet/docs/latest/online-win/overview/spwin-designerguide), refer to Chart Designer in the [SPREAD Designer Guide](/spreadnet/docs/latest/online-win/overview/spwin-designerguide/fpchart-chartdesigner).