KoolReport's Forum

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

How to show data labels and dual axis to google ComboChart #1838

Closed ankit raj opened this topic on on Jan 11, 2021 - 3 comments

ankit raj commented on Jan 11, 2021

Hi , i am using google chart to display combo chart of column and line. How to show data label for each value of column and line and a y axis on the right side for the line chart as well? This is my code:

  \koolreport\widgets\google\ComboChart::create(array(
            "title"=>$title,
            "dataSource"=>$data,
            "columns"=>array(
                "category",
                "value"=>array(
                    "label"=>"value",
                    "type"=>"number",
                    "role"=>'annotation'
                ),

                "avg"=>array(
                    "label"=>"Avg",
                    "type"=>"number",
                    "chartType"=>"line",
                ),
            ),
            "options"=>array(
                "plugins" => [
                    "datalabels" => $this->dataLabelsOptions // e.g: [ "color" => "blue" ]

                ],
                "responsive"=>true,
                "maintainAspectRatio"=> false,
                "legend"=>array(
                    "position"=>'bottom'
                ),
            ),
        ));
Sebastian Morales commented on Jan 12, 2021
ankit raj commented on Jan 12, 2021

Thanks , i was unable to find this documentation directly from the koolreport docs left menu bar. Please make sure if its removed by mistake.

Sebastian Morales commented on Jan 12, 2021

Yes, I can neither remember these chart features among other thousand ones. I was actually googling "koolreport google chart dual y axis" and "koolreport google chart showing label" to tell you the truth. Cheers,

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

None