michaeldrennen/highcharts

一个PHP库,可轻松为您的网站制作Highcharts图表。

v0.04 2021-11-14 19:58 UTC

This package is auto-updated.

Last update: 2024-09-20 14:27:13 UTC


README

Latest Stable Version Total Downloads License composer.lock available

一个帮助生成Highcharts图表的PHP库。

此库功能齐全,但在发布v1.0之前需要一些工作。

破坏性变更 - 2019-05-15

最新版本包含对库的破坏性变更,现在允许用户包含“全局”Highcharts选项。

// These will be applied to every chart on this page.
$globalOptions = [
            'lang' => [
                'thousandsSep' => ",",
            ],
        ];
        
$localOptions = [
    'title'    => ['text' => "My First Chart"],
    'subtitle' => ['text' => "It needs data"],
    'yAxis'    => [ 
        [
            'title' => [ 
                           'text' => "Scores" 
                       ],
            'type'            => 'linear',
            'floor'           => 0,
            'startOnTick'     => TRUE,
        ]
    ]
];
$chart = Highchart::make( 'highstock', 400, '100%' )
                  ->setGlobalOptions($globalOptions)
                  ->setLocalOptions( $localOptions );