There is no tutorial for this specific task, but there are two demos in the TAChart folder of your Lazarus installation (components/tachart/demo/db and components/tachart/demo/db-pieseries). The basic idea is as follows:
- Drop a TChart on the form
- Add a series to the chart (Double-click on the chart to open series editor, click '+ Add' and select the series type).
- Drop a TDBChartSource on the form. Set its Datasource property to the Datasource to which your dataset is connected.
- In the FieldX property specify the field to be used for x, and in FieldY specify the field to be used for y.
- Set the date/time Options if the x or y fields contain date/time data, and specify the DateTimeFormat to be used.
- Link the DBChartSource to the Source property of the series.
However, getting the values from the database this way is very inefficient internally, and it is highly recommended to copy the DBChartSource to a ListChartSource and link this to the series for plotting rather than the DBChartSource.