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)

  1. Put a charts component on the form
  2. Put a dbseries component on the form
  3. Bind the series to the chart
  4. Add a series of data
  5. Create onAddElement event
  6. Add line to add point(s) to chart
  7. 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