KoolReport's Forum

Official Support Area, Q&As, Discussions, Suggestions and Bug reports.
Forum's Guidelines

SparkLine Package #158

Open Jay opened this topic on on Nov 29, 2017 - 3 comments

Jay commented on Nov 29, 2017

Hi, Pls share sample code for using sparkline package with mysql dataset. Rgds/J

KoolReport commented on Nov 29, 2017

Hold on! We are making a working example for you,

Jay commented on Dec 19, 2017

Request update on this.

David Winterburn commented on Dec 20, 2017

Hi Jay,

Here are some examples for using the sparklines package:

<?php
use \koolreport\sparklines;

sparklines\Bar::create(array(
  "dataStore"=>$this->dataStore('salesQuarterCustomer'),
  "column" => "Quarter 1",
  "options"=>array(
    "barWidth"=>"10px",
  ),
  "height"=>"50px",
));

sparklines\Bullet::create(array(
  "dataStore"=>$this->dataStore('salesQuarterCustomer'),
  "column" => "Quarter 1",  
  "height"=>"50px",
));

sparklines\Tristate::create(array(
  "data" => array(5, 0, 9, -2, 0, -4),
  "options"=>array(
    "barWidth"=>"10px",
  ),
  "height"=>"50px",
));

sparklines\Line::create(array(
  "dataStore"=>$this->dataStore('salesQuarterCustomer'),
  "column" => "Quarter 1",
  "width"=>"50px",
  "height"=>"50px",
));

sparklines\Pie::create(array(
  "dataStore"=>$this->dataStore('salesQuarterCustomer'),
  "column" => "Quarter 1",
  "width"=>"50px",
  "height"=>"50px",
));

sparklines\Box::create(array(
  "dataStore"=>$this->dataStore('salesQuarterCustomer'),
  "column" => "Quarter 1",
  "width"=>"100px",
  "height"=>"50px",
));
?>

For more option for the charts, please refer to this doc: https://omnipotent.net/jquery.sparkline/#s-docs

Please let us know if you need anything. Thanks!

Build Your Excellent Data Report

Let KoolReport help you to make great reports. It's free & open-source released under MIT license.

Download KoolReport View demo
help needed

Sparklines