How do i load data on this

Can you change your success callback to this:

success: function(data){
  console.log(data);
}

and post the results.

HI pullo,

The reason why my graph did not move because

console.log(data.regularData)

Output to this

["7.00","116.00","25.00","60.00","26.00"]

how do i removed those double quotes so that it would look like this


[7.00,116.00,25.00,60.00,26.00]

Thank you in advance. :slight_smile:

Hi pullo, sorry i did not see your post…

Okay this is the result


casualData	["26.00", "1000.00"]
	
labels	["January", "February", "March", 2 more...]
	
regularData	["7.00", "116.00", "25.00", 2 more...]


Thank you in advance.

Hey jemz,

You can get rid of the quotes by making a small change to the PHP that outputs the data:

$results['regularDate'][] = (float)$row['amount'];

Putting (float) in front of the variable will cause PHP to cast the string to a float value.

HI fretburner,Thank you,it’s working :slight_smile:

@pullo, Is it possible that i can defined my own duration in chartjs. example by 5 or by 100 is this possible to in chartjs?,one more thing my graph will not move if the following months are empty. example by january i have data for regularData [200], then the rest of the months have no data,now my graph will not move because of this…but if i will put in the casaulData [0] the graph will move to 200…

Thank you in advance :slight_smile:

Sorry jemz, I don’t follow you?

I would sort this out on the server, so that you are returning an array of sensible values for chart.js to work with.