| Conditions | 1 |
| Paths | 1 |
| Total Lines | 22 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 1 |
| 1 | <?php |
||
| 42 | public function renderLegend() |
||
| 43 | { |
||
| 44 | $options = ArrayHelper::merge([ |
||
| 45 | 'id' => $this->options['id'] . '-legend', |
||
| 46 | 'class' => 'chart-legend', |
||
| 47 | ], $this->legend); |
||
| 48 | $tag = ArrayHelper::remove($options, 'tag', 'div'); |
||
| 49 | |||
| 50 | echo Html::tag($tag, '', $options); |
||
| 51 | $view = $this->getView(); |
||
| 52 | $view->registerJs("$('#{$options['id']}').html(chartJS_{$this->options['id']}.generateLegend());"); |
||
| 53 | $view->registerCss( |
||
| 54 | <<<'CSS' |
||
| 55 | .chart-legend li span { |
||
| 56 | display: inline-block; |
||
| 57 | width: 12px; |
||
| 58 | height: 12px; |
||
| 59 | margin-right: 5px; |
||
| 60 | } |
||
| 61 | CSS |
||
| 62 | ); |
||
| 63 | } |
||
| 64 | } |
||
| 65 |