Stacked bar chart 100 is derived from stacked bar chart. The only difference is that stacked bar chart 100 is limited to 100%. The values of the variables of a data series all add up to 100%.

How to display stacked bar chart 100 using Bunifu Dataviz

Simply locate Bunifu Dataviz control in your toolbox and drag it to the location on your form where you would like to display it. 

We will use button click event handler to display our chart called render_stacked_bar_100

C# code

private void render()
{
    var canvas = new Bunifu.DataViz.WinForms.Canvas();
    var datapoint = new Bunifu.DataViz.WinForms.DataPoint(Bunifu.DataViz.WinForms.BunifuDataViz._type.Bunifu_stackedBar100);
    datapoint.addxy("new Date (2002,11,10)", new JArray(16.23, 17.99).ToString());
    datapoint.addxy("new Date (2002, 11, 9)", new JArray(15.95, 19.25).ToString());
    datapoint.addxy("new Date (2002, 11, 8)", new JArray(11.30, 16.88).ToString());
    datapoint.addxy("new Date (2002, 11, 7)", new JArray(13.29, 14.28).ToString());
    datapoint.addxy("new Date (2002, 11, 6)", new JArray(15.23, 16.45).ToString());
    datapoint.addxy("new Date (2002, 11, 5)", new JArray(13.70, 16.50).ToString());
    datapoint.addxy("new Date (2002, 11, 4)", new JArray(17.50, 19.00).ToString());
    datapoint.addxy("new Date (2002, 11, 3)", new JArray(19.50, 20.85).ToString());
    datapoint.addxy("new Date (2002, 11, 2)", new JArray(20.07, 21.44).ToString());
    datapoint.addxy("new Date (2002, 11, 1)", new JArray(25.00, 26.70).ToString());
    canvas.addData(datapoint);
    bunifuDataViz1.Render(canvas);
}

VB.NET code

Private Sub render()
    Dim canvas = New Bunifu.DataViz.WinForms.Canvas()
    Dim datapoint = New Bunifu.DataViz.WinForms.DataPoint(Bunifu.DataViz.WinForms.BunifuDataViz._type.Bunifu_stackedBar100)
    datapoint.addxy("new Date (2002,11,10)", New JArray(16.23, 17.99).ToString())
    datapoint.addxy("new Date (2002, 11, 9)", New JArray(15.95, 19.25).ToString())
    datapoint.addxy("new Date (2002, 11, 8)", New JArray(11.30, 16.88).ToString())
    datapoint.addxy("new Date (2002, 11, 7)", New JArray(13.29, 14.28).ToString())
    datapoint.addxy("new Date (2002, 11, 6)", New JArray(15.23, 16.45).ToString())
    datapoint.addxy("new Date (2002, 11, 5)", New JArray(13.70, 16.50).ToString())
    datapoint.addxy("new Date (2002, 11, 4)", New JArray(17.50, 19.00).ToString())
    datapoint.addxy("new Date (2002, 11, 3)", New JArray(19.50, 20.85).ToString())
    datapoint.addxy("new Date (2002, 11, 2)", New JArray(20.07, 21.44).ToString())
    datapoint.addxy("new Date (2002, 11, 1)", New JArray(25.00, 26.70).ToString())
    canvas.addData(datapoint)
    bunifuDataViz1.Render(canvas)
End Sub

In order to display stacked bar chart 100 we need the following controls:

  • Bunifu Data Viz - This is the container for our chart
  • Bunifu Canvas - This is the middle layer between the data viz (container) and the dataset
  • Bunifu Data Point - This will contain the data that we want to represent as pairs of X and Y coordinates

Bunifu Stacked Bar 100 simply works by creating 2 data point objects, one for the “low” set of points and one for the “high” set of points. The control will know automatically to adjust the width of the lines to match the specified data points and also to fill the entire width of the graph.

On running the code you should see something like this:

That's it!

We hope Bunifu Dataviz will help you bring out the best data visualization for your data in your application. 

Should you have feedback or suggestions please send us via chat on the bottom right corner of the screen. 

Did this answer your question?