reactchartjs / react-chartjs-2

React components for Chart.js, the most popular charting library
https://react-chartjs-2.js.org
MIT License
6.51k stars 2.37k forks source link

[Bug]: Auto skip Y scale not working #1160

Open SneakingSlayer opened 1 year ago

SneakingSlayer commented 1 year ago

Would you like to work on a fix?

Current and expected behavior

// It still hides the ticks on smaller widths

import { Bar } from 'react-chartjs-2';

<Bar className="chartjs-render-monitor" data={[...data]} options = { { scales: { y : { autoSkip: false } } } } />

Reproduction

Set autoSkip false to the Y scale of any chart and see if it hides the ticks.

chart.js version

4.2.1

react-chartjs-2 version

^5.0.1

Possible solution

No response

Luise8 commented 7 months ago

Any progress here? I have the same problem with x scale.

SneakingSlayer commented 7 months ago

Any progress here? I have the same problem with x scale.

negative.

Luise8 commented 7 months ago

I found I had a mistake in callback. So now it's working for me.

"x": { 
        "ticks": {
          "autoSkip":    false,
          "maxRotation": 0,
          "font":        {
            "size":   "10px",
            "family": "Roboto, Helvetica,Arial,sans-serif",
          },
          //"callback":
          },
        },              
      },