1

I need to make a chart with data from 1 full year, but it has too many x labels.

I did this to remove some:

var labels= []

for(var i = 0; i< 360;i++) {
  labels.push(i%30 == 0 ? "":i);
}

This worked fine for a while, but now I need the tooltip to show the exact day so I need the label for that.

I'm using angularJs and ChartJs.

Evan Wieland
  • 1,445
  • 1
  • 20
  • 36
Thiago Kairala
  • 73
  • 1
  • 10
  • Possible duplicate of [show label in tooltip but not in x axis for chartjs line chart](http://stackoverflow.com/questions/31604040/show-label-in-tooltip-but-not-in-x-axis-for-chartjs-line-chart) – potatopeelings Dec 06 '15 at 00:50

1 Answers1

0

If you didn't specify autoSkip: false for ticks of x-axes, you should have x-axes labels auto skipped. It is by default true. So you shouldn't have overwhelming labels, plus tooltips should still show those auto skipped data.

 xAxes: [{
     ticks: {
         autoSkip: false,
         fontSize: 11,
         ...
     }
 }]
Evan Wieland
  • 1,445
  • 1
  • 20
  • 36
Liying
  • 1