akhibam

Members
  • Content count

    1
  • Joined

  • Last visited

Everything posted by akhibam

  1. Hi, before this Im working with flot.js with PHP and MYSQL. Currently im working on JSP with FusionCharts. I want to load 10 latest data(this is done in query) from MySQL and load it in FusionCharts Line Chart. Question is how to do this? Really blank right now. This is how I take data from MySQL in PHP : PHP <?php $dataGlucose = array(); $ctrGlucose = 0; while ($rowGlucose = mysql_fetch_array($resultGlucose, MYSQL_ASSOC)){ $dataGlucose[] = array( $ctrGlucose, $rowGlucose['glucose'] ); $ctrGlucose++; } ?> Javascript (Flot.js) $(function() { var d1 = <?php echo json_encode($dataSys); ?>; var d2 = <?php echo json_encode($dataDias); ?>; var stack = 0, bars = false, lines = true, steps = false; function plotWithOptions() { $.plot("#graphBlood", [ d1, d2], { series: { stack: stack, lines: { show: lines, fill: true, steps: steps }, bars: { show: bars, barWidth: 0.5 } }, colors: ["#4BB74C", "#840000"], }); } plotWithOptions(); }); Hope the pros here can help me. Thanks a lot