html - PHP data to plot -


i have 2 arrays representing x , y values don't seem in right format. want convert this: wrong

into this: right

the code used first 1 is:

$dataset2[] = array(floatval($row["x"]),intval($row["y"])); 

and second 1 is:

$dataset2[] = array(($x),($y)); 

in second case have x , y arrays of numbers , in first case mode of obtaining them bit different, , nope, unfortunately can't values in first case in second one.

to convert use:

var dataset1 = <?php echo json_encode($dataset2); ?>; 

in both cases. thanks!

try ..

var = floatval($row["x"]); var b = intval($row["y"]);  for(var = 0; < a.length; i++){     $dataset2[] = array(a[i],b[i]); } 

Comments

Popular posts from this blog

java - Andrioid studio start fail: Fatal error initializing 'null' -

android - Gradle sync Error:Configuration with name 'default' not found -

StringGrid issue in Delphi XE8 firemonkey mobile app -