Building a chart
Building a chart
To create a chart fully manual, put a chart component on the form and a series component. If you set up the properties right, you can run the application to see the result.
Adding data manually
To add data manually to a chart, you can use the function
public function addElement($value, $label, $bgcolor, $bordercolor)
- Put a charts component on the form
- Put a dbseries component on the form
- Bind the series to the chart
- Add a series of data
- Create onAddElement event
- Add line to add point(s) to chart
- Generate and run the application
Example
Suppose you want to set some point by default and add another point in the code. To add points to the chart, we use the onAddElement that is triggered when all default (and database) points are added:
The Default form looks like this:
Set the series like this
Connect properties
Now create the event:
Run the application