I'm trying to display a chart with highcharts. I have a 2-dimension-Array with values for Inductance and Current. How can I use that data to display a chart? I was looking for it, but I didn't find the correct answer... In the highcharts demos there are only cases wich you write directly the values, but never use an Array. I'm using html+php+javascript in my web page. If someone could help me, I would appreciate so much.
Thanks in advance and best regards.
P.S: If someone knows another way to display charts easier, I also would appreciate.
EDIT:
Thanks for answer. I think that I don't understand so well this library... I will post my code
//I initialize the array with the name Array_L_I_XXXX with the results from my SQL query
while($row4 = mysqli_fetch_array($result3))
{
$Array_L_I_XXX[j][0] = $row4['L_value'];
$Array_L_I_XXX[j][1] = $row4['I_value'];
$j++;
}
echo "<div style=\"margin: 0 1em\">";
echo "<script src=\"http://code.highcharts.com/highcharts.js\"></script>";
echo "<script src=\"http://code.highcharts.com/modules/exporting.js\"></script>";
echo "<div id=\"container\" style=\"min-width: 400px; height: 400px; margin: 0 auto\"></div>";
Also, in the <head> part, I have the following code
<script type="text/javascript">
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
series: [{
data: [<?php echo join($Array_L_I_XXX, ',') ?>],
pointStart: 0,
pointInterval
}]
});
</script>
That doens't work (for sure is so wrong...) but really I can't find the correct way to do this... Thanks!
I have my 2D-array in php
Array_L_I[X][Y], and now, I insert the following code to call the highchart function:echo ""; echo "http://code.highcharts.com/highcharts.js\">";
echo "<div id=\"container\" style=\"min-width: 400px; height: 400px; margin: 0 auto\"></div>";- In the
<head>section I have the code Highchart conde
- In the
My problem is that I don't know how to "send" this array to the highchart function to use my values (It is not like a js function that I can send some variables...)