score:1

yes you can do the same by using tickoption in the y axes

public barchartoptions: chartoptions = {
responsive: true,
showlines: false,
tooltips: {enabled: false},
animation: {duration: 2000},
scales: {
    yaxes: [{
        gridlines: {
            display:false
        },
        display: false,
        ticks: {
          max : 100,
          min: 0
        }
    }]
  }
};

also, steps and stepvalue is not working and i checked the same in their library its not written there also.

barchartdata: chartdatasets[] = [
          {
            data: [40, 30, 30],
            "backgroundcolor": this.bgcolors
          }
 ];

in the above, i need only y bar graphs so i set the data like that and for the three values, i used the same size of barchartlabels.

barchartlabels: label[] = ['a', 'b', 'c'];

this works for me, i hope it will work in your code too :)

score:4

in my name.component.html:

<div style="display: block">
<canvas basechart height="100" [datasets]="linechartdata" [labels]="linechartlabels" [options]="linechartoptions"
    [colors]="linechartcolors" [legend]="linechartlegend" [charttype]="linecharttype"></canvas>

in my name.component.ts:

 public linechartoptions: any = {
    scales : {
        yaxes: [{
            ticks: {
            beginatzero: true,
                stepvalue: 10,
                steps: 20,
              max : 50,
            }
        }]
      }
};

score:7

try adding the following to your chart options:

scales : {
  yaxes: [{
     ticks: {
        steps : 10,
        stepvalue : 10,
        max : 100,
        min: 0
      }
  }]
}

https://github.com/valor-software/ng2-charts/issues/853


Related Query

More Query from same tag