codeigniter-highcharts-library
codeigniter-highcharts-library copied to clipboard
Passing null values to missing points graphs
In case you need to pass null values to generate non linear data rows, you can't since the class simply discards empty or null values.
This is the fix for the moment: [file:application/library/highcharts.php:343]
public function push_serie_data($value = '', $serie_name = ''){
if ($serie_name AND $value)
{
$index = $this->find_serie_name($serie_name);
$value = (is_numeric($value)) ? (float)$value : $value;
$this->opts['series'][$index]['data'][] = $value;
} else {
if($value===NULL) {
$index = $this->find_serie_name($serie_name);
$value = null;
$this->opts['series'][$index]['data'][] = $value;
}
}
return $this;
}
Maybe simply by not testing value ?
public function push_serie_data($value = '', $serie_name = ''){
if ($serie_name)
{
$index = $this->find_serie_name($serie_name);
$value = (is_numeric($value)) ? (float)$value : $value;
$this->opts['series'][$index]['data'][] = $value;
}
return $this;
}