首页 > 解决方案 > Can a chart-line show a legend like chart-radar (for instance)?

问题描述

I have the angularjs chartline:

  <canvas id="line" class="chart chart-line" chart-data="data" chart-series="series" chart-labels="labels" chart-options="options" chart-legend="true">
    </canvas>

I want it to show legend (series) on the top of chart like how it works at chart-radar. enter image description here

I have all settings for this, but it doesn't work properly:

   $scope.options = { legend: { display: true } };

enter image description here

How to do it?

标签: angularjsangular-chart

解决方案


It was necessary to add to the options namespace. Like this:

  $scope.options = {

    legend: {display: true}

 };

推荐阅读