miloschuman / yii2-highcharts

Highcharts widget for Yii 2 Framework
http://www.yiiframework.com/extension/yii2-highcharts-widget/
MIT License
166 stars 63 forks source link

Highcharts error #17 (treemap not supported)? #78

Closed mablebee closed 5 years ago

mablebee commented 5 years ago

I upgraded with composer to most current version (including highcharts) but it seems that treemaps are not supported.

In the browser console I receive error #17 which seems to indicate, that there is no such series type (I have defined 'type' => 'treemap'

        initSeries: function (options) {
            var chart = this, optionsChart = chart.options.chart, type = (options.type ||
                optionsChart.type ||
                optionsChart.defaultSeriesType), series, Constr = seriesTypes[type];
            // No such series type
            if (!Constr) {
                H.error(17, true, chart);
            }

Can you help me find the issue to get treemaps working with yii2? Thx, Martin

mablebee commented 5 years ago

Found the solution - the modules/treemap module needed to be loaded additionally

    print Highcharts::widget([
        'scripts' => [
            'modules/exporting',
            **'modules/treemap',**
            'themes/grid-light',
        ],
        'options' => [
            'chart' => [
                'renderTo' => 'treeview-container',
            ],
            'series' => [[
               'type' => 'treemap',