Creating a bar chart
In the same way as with the pie chart, first prepare the CT. Again in the same way as creating the pie chart, let's change the JavaScript file and create the bar chart HTML (source file: 07_making_a_bar_chart/ct/dashboard/bar_app.html
).
Apart from the created class name (MyApp.view.dashboard.Bar
), the JavaScript file here is the same as the pie chart (source file: 07_making_a_bar_chart/ct/dashboard/bar_app.js
).
Implementing the Direct function
Now, it's the Direct
function. As the definition is already made in config.php
, I will not repeat it here.
Let's go ahead and implement the Direct
method (getBarData
) to get the data for the bar chart. Please refer to the source code in the source file if you want to see the content (source file: 08_implement_direct_function/php/classes/ MyAppDashBoard.php
). It will acquire the count for the levels of quotations or bills created for each client.
Preparing the store for the chart
Next comes the model store in the same way as we did for...