# Bunifu Line Chart

## Overview

**Bunifu Line** **Chart** is a chart component that renders a dataset as a single line path on the canvas. It can also be set to render area charts suitable for displaying quantitative data, often for comparing two sets of data.&#x20;

Here is an example of a sales dashboard using Bunifu Line Chart.

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZXFRDYf4jYa9rW_NDQ%2F-MZXH3gpoo0fb8UY4Uj5%2Fline09.gif?alt=media\&token=a4629f0e-4716-45c9-847e-e22458620d70)

## Getting started

### Getting started with Design View

This section explains to you the steps required to start creating a simple line chart in the design view.

Step 1: Drag the canvas control to the form from the toolbox

Step 2: In the property window of the `canvas` on the **labels** property, add the following values in the string collection editor window as shown below:

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZRis79lIpChYYm3e6B%2F-MZRme6ahv1vi5EmkPqm%2Fimage.png?alt=media\&token=7b61cb12-8ccc-4e80-ba3d-ec6afd9e12aa)

Step 3: From the toolbox drag and drop `BunifuLineChart` to the form.

Step 4: Click the ellipsis button on the **Data** property of `BunifuLine`, and add the following values to the collection window editor displayed as shown below:

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZRis79lIpChYYm3e6B%2F-MZRpITSgFbcrvk6z3fW%2Fimage.png?alt=media\&token=814423f1-3689-4d92-b791-d8cb23ca37d1)

Step 5: Go to the property named **TargetCanvas**  select `bunifuChartCanvas1` as the **target** component.

Step 6: Advance to `BunifuLineChart` properties and set a name on the **Label** property. An example would be ***No. of Solid State Drives repaired*****.**&#x20;

Step 7: Run the application.

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZZQdW9UMpOqJS9sBm3%2F-MZZT8IkrsODA-Jend5v%2Fimage.png?alt=media\&token=cd101c37-315f-4a7b-b33f-d8e0ec2d2f79)

Advance to `BunifuLineChart` properties and set a name on the **Label** property. An example would be ***No. of Solid State Drives repaired*****.**&#x20;

Alternatively, we can code and render a **line** chart without using the design view. Here's how to do it:

### Code View

{% tabs %}
{% tab title="C#" %}

```csharp
 void renderLineChart()
        {
            Bunifu.Charts.WinForms.ChartTypes.BunifuLineChart bunifuLineChart = new Bunifu.Charts.WinForms.ChartTypes.BunifuLineChart();
            /*
             * For this example we will use random numbers
             */
            var r = new Random();

            /*
             * Add your data from your source - accepts double list
             * Below is an example from a random number
             */
            List<double> data = new List<double>();
            data.Add(-30);
            for (int i = 0; i < 5; i++)
            {
                data.Add(r.NextDouble());
            }
            /*
             * Set your data             
             */
            bunifuLineChart.Data = data;

            /*
             * Specify the target canvas
             */
            bunifuLineChart.TargetCanvas = bunifuChartCanvas1;

            /*
             * Add labels to your canvas
             * Label count should correspond to data count for charts like Bar charts
             */
            bunifuChartCanvas1.Labels = new string[] { "Label1", "Label2", "Label3", "Label4", "Label5" };

            /*
             * Beautify the chart by sepcifying the colors
             */            

            bunifuLineChart.BackgroundColor = Color.Purple;
        }

```

{% endtab %}

{% tab title="VB" %}

```csharp
Private Sub renderLineChart()
    Dim bunifuLineChart As Bunifu.Charts.WinForms.ChartTypes.BunifuLineChart = New Bunifu.Charts.WinForms.ChartTypes.BunifuLineChart()
    ' 
    '  For this example we will use random numbers
    ' 
    Dim r = New Random()

    ' 
    '  Add your data from your source - accepts double list
    '  Below is an example from a random number
    ' 
    Dim data As List(Of Double) = New List(Of Double)()
    data.Add(-30)

    For i As Integer = 0 To 5 - 1
        data.Add(r.NextDouble())
    Next

    ' 
    '  Set your data             
    ' 
    bunifuLineChart.Data = data

    ' 
    '  Specify the target canvas
    ' 
    bunifuLineChart.TargetCanvas = bunifuChartCanvas1

    ' 
    '  Add labels to your canvas
    '  Label count should correspond to data count for charts like Bar charts
    ' 
    bunifuChartCanvas1.Labels = New String() {"Label1", "Label2", "Label3", "Label4", "Label5"}

    ' 
    '  Beautify the chart by sepcifying the colors
    ' 

    bunifuLineChart.BackgroundColor = Color.Purple
End Sub

```

{% endtab %}
{% endtabs %}

{% hint style="success" %}
Let us examine Bunifu Line charting properties.
{% endhint %}

## Line properties

### 1. CubicInterpolationMode&#x20;

This property gets and sets the algorithm that draws the curves of a **spline line chart**. The **default** algorithm uses a custom weighted cubic interpolation, which renders smooth curves, and the **monotone** algorithm preserves monotonicity (i.e. it reserves a strict order of the dataset being interpolated/plotted) suitable for presenting **y=f(x)** datasets.&#x20;

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZRtOrfBSvlWiqxa83r%2F-MZSdq3krO7gkQwSFPrY%2Fline05.gif?alt=media\&token=d4acccac-3e27-4c7c-881c-b5c93dead72a)

the code below illustrates how to set the cubic interpolation at run-time.

{% tabs %}
{% tab title="C#" %}

```csharp
     private void bunifuRadioButton1_CheckedChanged2(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
            if (e.Checked)
            {
                //sets the default cubic interploation mode
                bunifuLineChart1.CubicInterpolationMode = BunifuLineChart.CubicInterpolationModes.Default;
            }
            else
            {
                //sets a monotone cubic interpolation mode
                bunifuLineChart1.CubicInterpolationMode = BunifuLineChart.CubicInterpolationModes.Monotone;
            }
        }
```

{% endtab %}

{% tab title="VB.NET" %}

```groovy
	 Private Sub bunifuRadioButton1_CheckedChanged2(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
			If e.Checked Then
				'sets the default cubic interploation mode
				bunifuLineChart1.CubicInterpolationMode = BunifuLineChart.CubicInterpolationModes.Default
			Else
				'sets a monotone cubic interpolation mode
				bunifuLineChart1.CubicInterpolationMode = BunifuLineChart.CubicInterpolationModes.Monotone
			End If
	 End Sub

```

{% endtab %}
{% endtabs %}

### 2. LineTension

Gets and sets a **double numeric value** that changes a **curve tension** of a **spline** line chart. A zero value renders straight line charts.&#x20;

{% hint style="danger" %}
Note that the property doesn’t work when

1. a monotone algorithm is used in the cubic interpolation mode property.
2. rendering a stepped line chart.
   {% endhint %}

### 3. Order

This property gets and sets the z-order index of a dataset in the case of multiple datasets. A dataset having a less order number will be displayed in front of other line datasets.&#x20;

{% hint style="info" %}
For example,  let's have a pair of charts targeted to the same canvas. The line chart to have an order value of **0** and another chart set to an order value 1. The chart which has an order value of **0** will be displayed on top of the other chart components that have a value of 1 and above.&#x20;
{% endhint %}

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZW-hv28gjlqIXRjPW9%2F-MZW2MYMlw2A69MlS5Gt%2Fline08.gif?alt=media\&token=eadc99c0-aaa9-4f40-b598-255e2ed80194)

{% hint style="info" %}
&#x20;An additional point to note is that a higher negative ordered line plot will render the line chart above other chart components( such as lines, area, scatter plot, bar, etc.), that have a lower negative order value.
{% endhint %}

As can see, the code below assigns different higher negative order values to render the line plots above the other line plots.&#x20;

{% tabs %}
{% tab title="C#" %}

```csharp
  private void setBorderWidth(BunifuLineChart bunifuLineChart, int width)
        {
            bunifuLineChart.BorderWidth = width;
        }
        private void bunifuRadioButton1_CheckedChanged2(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
         
            if (e.Checked){
                bunifuLineChart1.Order = 0;
                bunifuLineChart2.Order = 1;
                bunifuLineChart3.Order = 2;
                setBorderWidth(bunifuLineChart1, 6);
                setBorderWidth(bunifuLineChart2, 3);
                setBorderWidth(bunifuLineChart3, 3);
            }
        }
 
        private void bunifuRadioButton2_CheckedChanged2(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
          
            if (e.Checked)
            {
                bunifuLineChart2.Order = -1;
                bunifuLineChart1.Order = 0;
                bunifuLineChart3.Order = 2;
                setBorderWidth(bunifuLineChart2, 6);
                setBorderWidth(bunifuLineChart1, 3);
                setBorderWidth(bunifuLineChart3, 3);
            }
        }

        private void bunifuRadioButton3_CheckedChanged2(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
            if (e.Checked)
            {
                bunifuLineChart3.Order = -2;
                bunifuLineChart1.Order = 0;
                bunifuLineChart2.Order = 2;
                setBorderWidth(bunifuLineChart3, 6);
                setBorderWidth(bunifuLineChart2, 3);
                setBorderWidth(bunifuLineChart1, 3);
            }
        }
```

{% endtab %}

{% tab title="VB.NET" %}

```fsharp
Private Sub setBorderWidth(ByVal bunifuLineChart As BunifuLineChart, ByVal width As Integer)
			bunifuLineChart.BorderWidth = width
End Sub
		Private Sub bunifuRadioButton1_CheckedChanged2(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)

			If e.Checked Then
				bunifuLineChart1.Order = 0
				bunifuLineChart2.Order = 1
				bunifuLineChart3.Order = 2
				setBorderWidth(bunifuLineChart1, 6)
				setBorderWidth(bunifuLineChart2, 3)
				setBorderWidth(bunifuLineChart3, 3)
			End If
		End Sub

		Private Sub bunifuRadioButton2_CheckedChanged2(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)

			If e.Checked Then
				bunifuLineChart2.Order = -1
				bunifuLineChart1.Order = 0
				bunifuLineChart3.Order = 2
				setBorderWidth(bunifuLineChart2, 6)
				setBorderWidth(bunifuLineChart1, 3)
				setBorderWidth(bunifuLineChart3, 3)
			End If
		End Sub

		Private Sub bunifuRadioButton3_CheckedChanged2(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
			If e.Checked Then
				bunifuLineChart3.Order = -2
				bunifuLineChart1.Order = 0
				bunifuLineChart2.Order = 2
				setBorderWidth(bunifuLineChart3, 6)
				setBorderWidth(bunifuLineChart2, 3)
				setBorderWidth(bunifuLineChart1, 3)
			End If
		End Sub

```

{% endtab %}
{% endtabs %}

### 4.ShowLine

This property gets and sets a boolean value (**true or false**) to hide or show the line on the canvas. A false value will hide the line plot but display the data points.&#x20;

### 5. SteppedLine

This property gets and sets the type of line to render on the canvas. Values of a stepped line include;

**False**: does not render a step plot. It is the common default value, for rendering a spline chart

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZWuWog4onyemEY-lsW%2F-MZX5jrAUr69S6Afk8th%2Fimage.png?alt=media\&token=c881348d-9186-4184-86ff-641a0fe2cf9b)

**Before**: renders a plot value before the next step of a data category. The same graphical plot is also applied with the true value. Below is its illustration

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZWuWog4onyemEY-lsW%2F-MZX61j0ndb4An3Ni9cU%2Fimage.png?alt=media\&token=50cb772e-9f38-48d9-9647-99cf2f83a330)

**Middle**: renders a plot value in the middle step of a data category&#x20;

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZWuWog4onyemEY-lsW%2F-MZX8_FgV1knqbYmdCJx%2Fimage.png?alt=media\&token=eca8651d-8fa3-4fcd-a974-fa97b821dcc7)

**After**: which renders a plot value after the next step of data category.

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZWuWog4onyemEY-lsW%2F-MZX91J7F23F0ZPQZnCU%2Fimage.png?alt=media\&token=6dc08918-a8bc-4baa-8a14-1a047c64dc41)

## **Border (Line plot) properties**

### **1. BorderCapStyle**

This property gets or sets the end cap style of a line plot. The property can be set to one of the following the values can be configured as follows:

**Butt** - renders a squared border style for the line plot's beginning and end. This is the line plot's default value.&#x20;

**Square** - functions similarly as a **Butt** prop value where it renders a squared border cap at the end and at the start of the line plot.&#x20;

**Round** - renders a rounded cap at the start and at the end of the line plot.

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZbAiodcxrq523-DBIy%2F-MZbctuo55tz4iOHt-E-%2Fline11.gif?alt=media\&token=a236e782-d6ac-4f26-a6d7-202cc9693f61)

The following code demonstrates how to change the border cap at run-time.

{% tabs %}
{% tab title="C#" %}

```csharp
   using Bunifu.Charts.WinForms.ChartTypes;
   private void bunifuRadioButton1_CheckedChanged(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
            if (e.Checked)
            {
                bunifuLineChart1.BorderCapStyle = BunifuLineChart.LineCaps.Butt;
                bunifuChartCanvas1.Update();
            }
         
        }

        private void bunifuRadioButton2_CheckedChanged(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
            if (e.Checked)
            {
                bunifuLineChart1.BorderCapStyle = BunifuLineChart.LineCaps.Round;
                bunifuChartCanvas1.Update();
            }
        }
```

{% endtab %}

{% tab title="VB.NET" %}

```go
Imports Bunifu.Charts.WinForms.ChartTypes
   Private Sub bunifuRadioButton1_CheckedChanged(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
			If e.Checked Then
				bunifuLineChart1.BorderCapStyle = BunifuLineChart.LineCaps.Butt
				bunifuChartCanvas1.Update()
			End If

   End Sub

		Private Sub bunifuRadioButton2_CheckedChanged(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
			If e.Checked Then
				bunifuLineChart1.BorderCapStyle = BunifuLineChart.LineCaps.Round
				bunifuChartCanvas1.Update()
			End If
		End Sub

```

{% endtab %}
{% endtabs %}

### **2. BorderWidth**

This property gets and sets an integer value that changes the line plot's width. The greater the value, the denser the line plot.

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZbdRIIFExQdawnxcgE%2F-MZcGZ-Q7J7xFdpZzgbt%2Fline14.gif?alt=media\&token=3628bb7d-6a01-4c12-9395-e32c1fe55f04)

## **Data Point properties**

### **1. PointBackgroundColor**

This property sets or gets a data point background color on the line plot.&#x20;

### **2. PointBorderColor**

This property gets and sets a color value to the point border on a line plot.

### **3. PointBorderWidth**

This property gets and sets an integer number that changes the border width of the line's data points.

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZcTIczNd_epK-mB7fU%2F-MZdaq4AB2QUcG_4JSHc%2Fline15.gif?alt=media\&token=e2ad8250-e1ce-404a-8bf5-be3da23feaea)

### **4. PointRadius**

This property gets or sets the integer value that decreases or increases the radius of a point (i.e. distance from the point’s center to its border). It can as well be used to enlarge the points on a line plot.&#x20;

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZcTIczNd_epK-mB7fU%2F-MZdgZ0DGBFywS38yRrq%2Fline16.gif?alt=media\&token=25ba6557-3b0d-45f5-b378-3f2bef7f17a4)

### **5. PointStyle**

This property gets or sets a shape (circle, star, line, etc...) to render as a data point on the line plot.&#x20;

### **6. PointRotation**

This property gets or sets the integer value that changes the angle of points on a line plot.

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZgwfFjXB0yFSUhQFoN%2F-MZgwpYD3m5l_1pxwDiM%2Fline17.gif?alt=media\&token=13ecf9d8-57e6-40d1-89f6-ef1a0f12b782)

The code below shows how to set the PointStyle and PointRotation properties at run-time.

{% tabs %}
{% tab title="C#" %}

```csharp
using Bunifu.Charts.WinForms.ChartTypes;
using System;
//using a dropdown SelectedIndex property to change the style of a point
 private void bunifuDropdown1_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (bunifuDropdown1.SelectedIndex == 0)
            {
                bunifuLineChart1.PointStyle = BunifuLineChart.PointStyles.Circle;
            }
            else if (bunifuDropdown1.SelectedIndex == 1)
            {
                bunifuLineChart1.PointStyle = BunifuLineChart.PointStyles.CrossRot;
            }
            else if (bunifuDropdown1.SelectedIndex == 2)
            {
                bunifuLineChart1.PointStyle = BunifuLineChart.PointStyles.RectRounded;
            }
            else
            {
                bunifuLineChart1.PointStyle = BunifuLineChart.PointStyles.Triangle;
            }
        }
/*On an slider scroll event the PointRotation property of the
  line chart shall be set with the slider's value;*/
      private void bunifuHSlider1_Scroll(object sender, Utilities.BunifuSlider.BunifuHScrollBar.ScrollEventArgs e)
        {
            bunifuLineChart1.PointRotation = bunifuHSlider2.Value;
            bunifuChartCanvas1.Update();
        }
```

{% endtab %}

{% tab title="VB.NET" %}

```java
Imports Bunifu.Charts.WinForms.ChartTypes
Imports System
'using a dropdown SelectedIndex property to change the style of a point
 Private Sub bunifuDropdown1_SelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
			If bunifuDropdown1.SelectedIndex = 0 Then
				bunifuLineChart1.PointStyle = BunifuLineChart.PointStyles.Circle
			ElseIf bunifuDropdown1.SelectedIndex = 1 Then
				bunifuLineChart1.PointStyle = BunifuLineChart.PointStyles.CrossRot
			ElseIf bunifuDropdown1.SelectedIndex = 2 Then
				bunifuLineChart1.PointStyle = BunifuLineChart.PointStyles.RectRounded
			Else
				bunifuLineChart1.PointStyle = BunifuLineChart.PointStyles.Triangle
			End If
 End Sub
'On an slider scroll event the PointRotation property of the
'  line chart shall be set with the slider's value;
	  Private Sub bunifuHSlider1_Scroll(ByVal sender As Object, ByVal e As Utilities.BunifuSlider.BunifuHScrollBar.ScrollEventArgs)
			bunifuLineChart1.PointRotation = bunifuHSlider2.Value
			bunifuChartCanvas1.Update()
	  End Sub

```

{% endtab %}
{% endtabs %}

### **7. PointHoverBackgroundColor**

This property sets a color value property to the point's background when a mouse pointer hovers over a data point from the line plot.

### **8.  PointHoverBorderWidth**

This property sets an integer value property to the point's border width on a mouse hover. When a mouse pointer hovers over a data point in a line plot, this property sets an integer value property to the point's border width.

### **9. PointHoverRadius**

This property sets the integer value that decreases or increases the radius of a point (i.e. distance from the point’s center to its border), when a mouse pointer hovers over a data point from the line plot. It can as well be used to enlarge the hovered point on a line plot.&#x20;

## Creating Area Charts

Bunifu line can also be used to create spline-area charts or stepped-line area charts by utilizing the following properties:

### 1.BackgroundColor property

This property gets and sets the color value for the background fill. It can accept an RGB color specification or an ARGB color specification. In addition, the property is also used to set the colors of the line data points.

### 2. Fill property

This property gets and sets the type of fill mode for its background color. A false value will disable the fill mode. The following are the possible values to use in the property:

**Start:** Fills the background color on the bounded line plot area.

**Origin:** Fills the background color on the space within the bounding line. It has the same effect as setting the **Fill** property to the **start** value.

**End:** Fills the background color on the outer area of the bounding line plot.

**Blank:** This is the default value of rendering a line chart.  It renders a line plot without a background color around the boundary line.&#x20;

Here's a sample application using the FillType prop values at run-time as explained from above

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZYuhzfQcqrd9Ri8Fgf%2F-MZYyaRX1jHUw2PkRp4Q%2Fline10.gif?alt=media\&token=cf172c5f-991a-405a-ad16-c7ceb65ada96)

Setting the FillType property at runtime is demonstrated in the following code:

{% tabs %}
{% tab title="C#" %}

```csharp
  using Bunifu.Charts.WinForms.ChartTypes;
  using System;
  //the radio buttons are used to change the different values used in the FillType property.
  private void bunifuRadioButton1_CheckedChanged2(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
            if (e.Checked)
            {
                bunifuLineChart1.Fill = BunifuLineChart.FillOptions.Blank;
            }
        }

        private void bunifuRadioButton2_CheckedChanged2(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
            if (e.Checked)
            {
                bunifuLineChart1.Fill = BunifuLineChart.FillOptions.Start; 
            }
        }

        private void bunifuRadioButton3_CheckedChanged2(object sender, Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs e)
        {
            if (e.Checked)
            {
                bunifuLineChart1.Fill = BunifuLineChart.FillOptions.End; 
            }
        }
```

{% endtab %}

{% tab title="VB.NET" %}

```cpp
  Imports Bunifu.Charts.WinForms.ChartTypes
  Imports System
  'the radio buttons are used to change the different values used in the FillType property.
  Private Sub bunifuRadioButton1_CheckedChanged2(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
			If e.Checked Then
				bunifuLineChart1.Fill = BunifuLineChart.FillOptions.Blank
			End If
  End Sub

		Private Sub bunifuRadioButton2_CheckedChanged2(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
			If e.Checked Then
				bunifuLineChart1.Fill = BunifuLineChart.FillOptions.Start
			End If
		End Sub

		Private Sub bunifuRadioButton3_CheckedChanged2(ByVal sender As Object, ByVal e As Bunifu.UI.WinForms.BunifuRadioButton.CheckedChangedEventArgs)
			If e.Checked Then
				bunifuLineChart1.Fill = BunifuLineChart.FillOptions.End
			End If
		End Sub

```

{% endtab %}
{% endtabs %}

&#x20;There are 3 types of area charts that Bunifu Line can render: **single area charts (as shown in the above picture) , overlapping area charts, and stacked area charts.**

A single area chart contains one dataset category whereas overlapping and stacked area charts have at most 2 dataset categories.

{% hint style="warning" %}
**Avoid using area charts when there are more than 3-4 categories.** In that case use line charts.
{% endhint %}

To create an overlapping chart have a pair of bunifu lines each having different datasets. Each to have a FillType value of start and set its background colors.&#x20;

{% hint style="info" %}
Make the colors transparent to avoid obscuring information in the background. To set a transparent color use the Alpha, Red, Green and Blue (ARGB) color format.

In the example below, the background colors for the first line chart is **190,186,85,211**; and for the second line chart, is **100,249,233, 0.**
{% endhint %}

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZid91vecmWZxALi1Fs%2F-MZiiBcI6_Cp_I1Ojkw-%2Fimage.png?alt=media\&token=5aa06cf9-d2c4-4cd8-8bba-f46753fd2ec8)

To render a stacked area chart, set the canvas's **XAxesStacked** property to **true**. The outcome is depicted below.

![](https://1116551356-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-M7fmEPVv4n0I819sdaz%2F-MZid91vecmWZxALi1Fs%2F-MZihlSGQwPiyKxhmV6S%2Fimage.png?alt=media\&token=717c4c98-dbcd-4604-a257-80d24e97ec07)

## Take Away

Bunifu Line Chart is an excellent charting tool in condensing both small and large datasets into manageable visualizations - and it's more enjoyable than poring over tables. If you've ever designed a dashboard or worked on another project that requires data visualization, you understand how difficult it can be to design such dashboards. Bunifu Line chart is able to assist you in creating visually appealing dashboards.
