Yii2-Amcharts:我如何导出到图像?

时间:2017-04-28 18:26:57

标签: yii2 amcharts

在我看来,我有这张图 Graph

$chartConfiguration = [
    'type'         => 'serial',
    'dataProvider' => $datasProvider, 

   'rotate'        => false,
   'categoryField' => 'respuesta',


   'categoryAxis' => ['gridPosition' => 'start', 'axisColor' => '#DADADA'],
   'valueAxes'    => [['axisAlpha' => 0.2]],
   'graphs'       => [['type' => 'column',
                       'title' => 'Respuesta',

                       'valueField' => 'COUNT(*)',
                       'lineAlpha' => 0,
                       'fillColors' => '#BC1818',
                       'fillAlphas' => 1,
                       'balloonText' => '[[title]] in [[category]]:<b>[[value]]</b>'
                     ]],


];
echo \speixoto\amcharts\Widget::widget(['chartConfiguration' => $chartConfiguration]);

我知道我有这些

  • 'pathToImages'=&gt; '../到/我/路由'
  • 'export'=&gt; '真正的'

但这些作品中没有一个我试图使用Amcharts库(export.js和export.css

由于

1 个答案:

答案 0 :(得分:0)

您需要在UI中返回export

的对象
"export": {
  "enabled": true
}

"export": true还不够。

https://www.amcharts.com/kbase/intro-exporting-charts/