angular chart js type line setting chart-options not working

Hi I'm trying to configure the graph to be without any tooltips or legends, and it look's like all the configured options are ignored. what I'm doing wrong?

it's the js object:

$scope.options = {
    segmentShowStroke : false,
     elements: { arc: { borderWidth: 0 } ,  point: {
          radius: 0
        }},
     tooltips:{
            enabled:false
        },
    legend: {
             display: false
        },
    scales: {
      yAxes: [
        {
          id: 'y-axis-1',
          type: 'linear',
          display: false,
          position: 'left'
        }

      ]
    }
  };

And it's the canvas element :

<canvas id="line" class="chart chart-line"
chart-data="data" chart-labels="labels" chart-options="options"
chart-dataset-override="datasetOverride"
chart-click="onClick" height="40px" width="1000px"
chart-colors="graph.colors" style=" width: 1000px; ;max-height: 40px !important;">
</canvas>

Upvotes: 0

Views: 2871

Answers (2)

I managed to make it work, only after changing the options from chartjsProvider.setOptions like this

ChartJsProvider.setOptions('line',{
        segmentShowStroke : false,
         elements: { arc: { borderWidth: 0 } ,  point: {
              radius: 0
            }},
         tooltips:{
                enabled:false
            },
        legend: {
                 display: false
            },
        scales: {
             yAxes: [
                     {

                       display: false,

                     }

                   ],
                   xAxes: [
                           {

                             display: false,

                           }

                         ]
        }
    });

Upvotes: 0

Rohan Kawade
Rohan Kawade

Reputation: 473

Try this solution

options : {
    scales : {
        xAxes : [ {
            gridLines : {
                display : false
            }
        } ]
    }
}

Upvotes: 0

Related Questions