Using HighchartsPHP library in CakePHP

前端 未结 1 1566
忘掉有多难
忘掉有多难 2021-01-28 05:33

I am trying to use ghunti\'s HighchartsPHP wrapper in CakePHP so I can use it in my project.

In the demo it says to edit the config.php and include the scri

1条回答
  •  旧巷少年郎
    2021-01-28 06:17

    Your controller should be like this:

    chart = array(
                'renderTo' => 'container', // div ID
                'type' => 'line'
            );
    
            $chart->series[0]->name = 'Tokyo';
            $chart->series[0]->data = array(7.0, 6.9, 9.5);
    
            $this->set( compact( 'chart' ) );
        }
    
    }
    

    and index.ctp:

    printScripts(); ?>
    
    
    

    0 讨论(0)
提交回复
热议问题