KoolReport's Forum

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

Google Chart Line Width #2083

Closed Steph opened this topic on on May 14, 2021 - 1 comments

Steph commented on May 14, 2021

Hi All,

I am trying to set the line width on a Google chart as follows:

BarChart::create(array(
    "dataSource"=>$combined,
    "columns"=>array(
        "yearGroup" => array("prefix" => "Year "),
        "school"=>array("label"=>"Your School","type"=>"number"),
    ),
    "options"=>array(
        "legend"=>"none",
        "lineWidth"=>1,
        "hAxis"=>array("minValue"=>0, "maxValue"=>100),
        "colors"=>array("#acda84")
    )
));

Everything works and the chart displays, but the lineWidth setting does not work. As far as I can see it matches the Google Charts documentation (https://developers.google.com/chart/interactive/docs/lines).

Can anybody suggest what the issue is please - thanks in advance.

Steph commented on May 14, 2021

Annoyingly - 5 seconds after posting I realised my mistake - "lineWidth" is the option for line charts, for bar charts I have to do the following "bar"=>array("groupWidth"=>5), hopefully this will help anybody else having the same issue.

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
solved

None