Last active
November 21, 2017 10:15
-
-
Save Willy-Kimura/3bbd6647b8786ca40ff0d85d92067fac to your computer and use it in GitHub Desktop.
Method for generating Dataviz charts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Private Sub GenerateCharts() | |
' Let's begin by generating a chart that consists of an Area chart and a Line chart. | |
' We need to create one canvas that will host the first two charts inside it, that is, | |
' the Area chart and Line chart. | |
Dim multi_chart_canvas As New Canvas | |
' Create a new datapoints-set for the first chart - Area chart. | |
Dim area_chart_datapoints As New DataPoint(BunifuDataViz._type.Bunifu_area) | |
' Add the datapoints for the Area chart. | |
area_chart_datapoints.addLabely("l1", "45") | |
area_chart_datapoints.addLabely("l2", "60") | |
area_chart_datapoints.addLabely("l3", "50") | |
area_chart_datapoints.addLabely("l4", "80") | |
area_chart_datapoints.addLabely("l5", "70") | |
area_chart_datapoints.addLabely("l6", "90") | |
area_chart_datapoints.addLabely("l7", "100") | |
area_chart_datapoints.addLabely("l8", "95") | |
area_chart_datapoints.addLabely("l9", "60") | |
area_chart_datapoints.addLabely("l10", "45") | |
' Now add the Area chart to the canvas we created. | |
multi_chart_canvas.addData(area_chart_datapoints) | |
' Create a new datapoints-set for the second chart - Line chart. | |
Dim line_chart_datapoints As New DataPoint(BunifuDataViz._type.Bunifu_line) | |
' Add the datapoints for the Line chart. | |
line_chart_datapoints.addLabely("", "55") | |
line_chart_datapoints.addLabely("", "70") | |
line_chart_datapoints.addLabely("", "60") | |
line_chart_datapoints.addLabely("", "90") | |
line_chart_datapoints.addLabely("", "80") | |
line_chart_datapoints.addLabely("", "100") | |
line_chart_datapoints.addLabely("", "110") | |
line_chart_datapoints.addLabely("", "105") | |
line_chart_datapoints.addLabely("", "70") | |
line_chart_datapoints.addLabely("", "55") | |
' Then add the Line chart to the canvas we created. | |
multi_chart_canvas.addData(line_chart_datapoints) | |
' Finally render the multiple-chart canvas in our Dataviz component. | |
BunifuDataViz1.Render(multi_chart_canvas) | |
' Let's now create a new canvas for the Doughnut chart. | |
Dim doughnut_chart_canvas As New Canvas | |
Dim doughnut_chart_datapoints As New DataPoint(BunifuDataViz._type.Bunifu_doughnut) | |
' Add the datapoints for the Doughnut chart. | |
doughnut_chart_datapoints.addLabely("", "45") | |
doughnut_chart_datapoints.addLabely("", "60") | |
doughnut_chart_datapoints.addLabely("", "50") | |
doughnut_chart_datapoints.addLabely("", "80") | |
doughnut_chart_datapoints.addLabely("", "70") | |
doughnut_chart_datapoints.addLabely("", "90") | |
' Then add the Doughnut chart to the canvas we created. | |
doughnut_chart_canvas.addData(doughnut_chart_datapoints) | |
' Finally render the Doughnut chart canvas in our Dataviz component. | |
BunifuDataViz2.Render(doughnut_chart_canvas) | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment