Home forums Using CanvasJS Creating a chart from data with SQL DB [PHP] Reply To: Creating a chart from data with SQL DB [PHP]

#22169

Vishwas R
Keymaster

@d3bsky,

valueFormatString is used to format numbers and date time values (x-values) that appears on axisX but not for labels. Passing x-value to dataPoints should work fine in your case dps.push({"x":new Date(result[i].time), "y":result[i].humidity});.

To format labels, you can use labelFormatter.


Vishwas R
Team CanvasJS