Search code examples
phppchart

in pchart is it possible to have a barchart with only one column ( so only one value)?


Is it possible in pchart to have a barchart with only one value? I have a bar chart that display correctly with 1 serie with any number of values but pchart crashes when the series contains only one value.

If someone would let me know this would prevent me investigating any further.

Thank you.


Solution

  • Yes. Based on v1.27d you can modify their documentation example to just have one value in the $DataSet

    $DataSet->AddPoint(array(1),"Serie1");
    

    May need to use the chart's setFixedScale function to make sure it shows properly.