@Stella,
Please take a look at this gallery example on rendering chart by populating data from database using PHP.
If this doesn’t solve your requirement, please brief us further about it. Also kindly share a sample project over google-drive or one-drive reproducing the issue(if any) you are facing, so that we can look into your code, understand the scenario better and help you out.
__
Priyanka M S
Team CanvasJS