Bunifu Framework Docs
HomePricingFAQsMy Account
  • Introduction
  • Getting started
    • Requirements
    • Installation
    • Installing for .Net 5 & Above
    • Licensing
      • Managing your licenses
      • Bunifu Licensing CLI
      • Bunifu Device Remover (Deprecated)
  • BUNIFU UI
    • Controls
      • Bunifu Button
      • Bunifu Button (variant)
      • Bunifu Cards
      • Bunifu CheckBox
      • Bunifu Circle Progress
      • Bunifu Datagrid View
      • Bunifu Date Picker
      • Bunifu Drop Down
      • Bunifu Flat Button
      • Bunifu Form Caption Button
      • Bunifu Form Control Box
      • Bunifu Form Resize Icon
      • Bunifu Gradient Panel
      • Bunifu Icon Button
      • Bunifu Image Button (New)
      • Bunifu Image Button (Old)
      • Bunifu IOS Switch (1.5.3)
      • Bunifu Label
      • Bunifu Loader
      • Bunifu Picture Box
      • Bunifu Pages
      • Bunifu Panel
      • Bunifu Progress Bar
      • Bunifu Radial Gauge
      • Bunifu Radio Button
      • Bunifu Rating
      • Bunifu Range
      • Bunifu Separator
      • Bunifu Sliders
      • Bunifu Shadow Panel
      • Bunifu Shapes
      • Bunifu Switch (1.5.3)
      • Bunifu ScrollBars
      • Bunifu Toggle Switch
      • Bunifu Toggle Switch (variant)
      • Bunifu Tile Button
      • Bunifu Thin Button (1.5.3)
      • Bunifu ToolTip
      • Bunifu Textbox
      • Bunifu User Control
    • Components
      • Bunifu Color Transition
      • Bunifu Drag
      • Bunifu Elipse [Deprecated]
      • Bunifu Form Dock
      • Bunifu Form Drag
      • Bunifu Form Resizer
      • Bunifu Snackbar
      • Bunifu Transition
  • BUNIFU CHARTS
    • Introduction
      • Quick Tips
    • Chart Components
      • Bunifu Bar Chart
      • Bunifu Bubble Chart
      • Bunifu Canvas Control
      • Bunifu Doughnut Chart
      • Bunifu Horizontal bar Chart
      • Bunifu Line Chart
      • Bunifu Pie chart
      • Bunifu Polar Chart
      • Bunifu Radar Chart
  • BUNIFU DATAVIZ [Deprecated]
    • Basic Charts [Deprecated]
      • Step Line Chart [Deprecated]
      • Step Area Chart [Deprecated]
      • Spline Chart [Deprecated]
      • Pie Chart [Deprecated]
      • Line Chart [Deprecated]
      • Doughnut Chart [Deprecated]
      • Bar Chart [Deprecated]
      • Area Chart [Deprecated]
      • Column Chart [Deprecated]
    • Advanced Charts [Deprecated]
      • Stacked Column 100 Chart [Deprecated]
      • Stacked Column Chart [Deprecated]
      • Stacked Bar Chart 100 [Deprecated]
      • Stacked Bar Chart [Deprecated]
      • Stacked Area Chart 100 [Deprecated]
      • Stacked Area Chart [Deprecated]
      • Scatter Chart [Deprecated]
      • Range Spline Area Chart [Deprecated]
      • Range Column Chart [Deprecated]
      • Range Bar Chart [Deprecated]
      • Range Area Chart [Deprecated]
      • OHLC Chart [Deprecated]
      • Candle Stick Chart [Deprecated]
      • Bubble Chart [Deprecated]
Powered by GitBook
On this page
  • Getting Started fast with Bunifu Charts
  • Step 1
  • Step 2
  • Step 3
  • Step 4
  • Step 5

Was this helpful?

  1. BUNIFU CHARTS
  2. Introduction

Quick Tips

PreviousIntroductionNextChart Components

Last updated 4 years ago

Was this helpful?

Getting Started fast with Bunifu Charts

To get started quickly after Bunifu charts here are some of the tips to get you started quickly.

After loading the components to toolbox

Step 1

Find BunifuChartCanvas and drag and drop to your form of user control designer(see below)

Step 2

Next find your preferred chart component - drag and drop to your form or user control(see below)

You can as well use code below

Bunifu.Charts.WinForms.ChartTypes.BunifuBarChart bunifuChart= new Bunifu.Charts.WinForms.ChartTypes.BunifuBarChart();
Dim bunifuChart As Bunifu.Charts.WinForms.ChartTypes.BunifuBarChart = New Bunifu.Charts.WinForms.ChartTypes.BunifuBarChart()

Step 3

Select the chart component and specify the canvas and your data by using the designer or code(see below)

Designer

Code

/*
* 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>();
for (int i = 0; i < 5; i++)
{
  data.Add(r.NextDouble());
}
/*
* Set your data             
*/
bunifuBarChart1.Data = data;

/*
* Specify the target canvas
*/
bunifuBarChart1.TargetCanvas = bunifuChartCanvas1;
    ' 
    '  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)()

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

    ' 
    '  Set your data             
    ' 
    bunifuBarChart1.Data = data

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

Step 4

You'll need to specify the Labels for charts like Bar chart, so select your canvas and go to Labels Property and add your labels per line

Designer

Code

/*
* 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" };
' 
'  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"}

Step 5

Finally you'll need to beautify your chart by changing the background for each value. This can be done using code or by using the designer(see below)

Designer

Code

/*
* Beautify the chart by sepcifying the colors
* Color count should correspond to data count
*/
List<Color> bgColors = new List<Color>();
bgColors.Add(Color.Red);
bgColors.Add(Color.Blue);
bgColors.Add(Color.Green);
bgColors.Add(Color.Gray);
bgColors.Add(Color.Purple);
  
bunifuBarChart1.BackgroundColor = bgColors;
    ' 
    '  Beautify the chart by sepcifying the colors
    '  Color count should correspond to data count
    ' 
    Dim bgColors As List(Of Color) = New List(Of Color)()
    bgColors.Add(Color.Red)
    bgColors.Add(Color.Blue)
    bgColors.Add(Color.Green)
    bgColors.Add(Color.Gray)
    bgColors.Add(Color.Purple)
    bunifuBarChart1.BackgroundColor = bgColors

Or generate random colors

/*
* Beautify the chart by sepcifying the colors
* Color count should correspond to data count
*/
List<Color> bgColors = new List<Color>();
for (int i = 0; i < data.Count; i++)
 {
   bgColors.Add(Color.FromArgb(r.Next(256), r.Next(256), r.Next(256)));
 }

bunifuPieChart.BackgroundColor = bgColors;
    ' 
    '  Beautify the chart by sepcifying the colors
    '  Color count should correspond to data count
    ' 
    Dim bgColors As List(Of Color) = New List(Of Color)()

    For i As Integer = 0 To data.Count - 1
        bgColors.Add(Color.FromArgb(r.[Next](256), r.[Next](256), r.[Next](256)))
    Next

    bunifuPieChart.BackgroundColor = bgColors

Here is the complete code

/*
* 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>();
for (int i = 0; i < 5; i++)
{
  data.Add(r.NextDouble());
}
/*
* Set your data             
*/
bunifuBarChart1.Data = data;

/*
* Specify the target canvas
*/
bunifuBarChart1.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
* Color count should correspond to data count
*/
List<Color> bgColors = new List<Color>();
for (int i = 0; i < data.Count; i++)
 {
   bgColors.Add(Color.FromArgb(r.Next(256), r.Next(256), r.Next(256)));
 }

bunifuPieChart.BackgroundColor = bgColors;

    ' 
    '  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)()

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

    ' 
    '  Set your data             
    ' 
    bunifuBarChart1.Data = data

    ' 
    '  Specify the target canvas
    ' 
    bunifuBarChart1.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
    '  Color count should correspond to data count
    ' 
    Dim bgColors As List(Of Color) = New List(Of Color)()

    For i As Integer = 0 To data.Count - 1
        bgColors.Add(Color.FromArgb(r.[Next](256), r.[Next](256), r.[Next](256)))
    Next

    bunifuPieChart.BackgroundColor = bgColors

For complete code for whole Bunifu Charts see this

gist
installing and licensing