Get KoolPHP UI with 30% OFF!

Regarding array data in KoolCharts

Raghavendra
Hi,
How to get column chart drawn by taking the array data from the database?
Please kindly give response as soon as possible.
Posted Apr 14, 2016 Kool
Jayme
Hello Raghavendra,
I am doing that in a LineSeries by adding elements to the array data in a while loop :
      $stmt = oci_parse($db->MyConn, $query );
      if( $stmt ){
        oci_bind_by_name($stmt,':ANOBAL', $anobal);
        oci_bind_by_name($stmt,':DATAFIM', $maxbal);
        oci_bind_by_name($stmt,':balanco', $bal);
        $r = oci_execute($stmt);
        if($r){
          $lstDt = "";
          while( ($rbal = oci_fetch_array($stmt, OCI_ASSOC )) != false ){
            $somaTot += ($rbal["ENEATVDIRFP"]+$rbal["ENEATVDIRPT"]+$rbal["ENEATVDIRRE"]) / 1000000 ;
            $somaFP  +=  $rbal["ENEATVDIRFP"]/1000000 ;
            array_push($serTot, $somaTot ) ;
            array_push($serFP, $somaFP   )  ;
            if($rbal["ENEATVDIRFP"] > 0 ) $lstDt = $rbal["DATADIA"];
          }
        }
        oci_free_statement($stmt);
      }
// Sorry I forgot a important part of the code:
<cut>
$series->ArrayData($serTot);  
.....

Of course it is a query to an Oracle database, but the idea it's the same.
Best regards.
Jayme Jeffman
Posted May 19, 2017 , edited May 19, 2017 Kool
Anthony Amolochitis
They have a really good sample on their demo page as well.
http://demo.koolphp.net/Examples/KoolChart/ChartTypes/Column_Chart/index.php
Posted May 19, 2017 Kool
Jayme
The sample you have pointed to do not use any database source, though.
I am still waiting for a way to add value pairs to the chart through JavaScript methods and rebuild the chart as well, or something like the KoolGrid does when we call the JavaScript KoolChart::attachData() method, which provide a way of rebuild the grid at server.
Best regards.
Jayme Jeffman
Posted May 19, 2017 Kool