Creating a pie chart
First, we made the CT for display purposes, but now let's create the CT to make it run.
We will use the Direct
function, so let's prepare that as well. In reality we've done this already.
Duplicate a different app.html
and change the JavaScript file like we have done before. Please see the source file for the code: 03_making_a_pie_chart/ct/dashboard/pie_app.html
.
Implementing the Direct function
Next, prepare the Direct
function to read the data.
First, it's the config.php
file that defines the API
. Let's gather them together and implement the four graphs (source file: 04_implement_direct_function/php/config.php
).
.... 'MyAppDashBoard'=>array( 'methods'=>array( 'getPieData'=>array( 'len'=>0 ), 'getBarData'=>array( 'len'=>0 ), 'getLineData'=>array( 'len'=>0 ), 'getRadarData'=>array( 'len...