react-chartjs-2 icon indicating copy to clipboard operation
react-chartjs-2 copied to clipboard

[Bug]: Auto skip Y scale not working

Open SneakingSlayer opened this issue 2 years ago • 3 comments

Would you like to work on a fix?

  • [ ] Check this if you would like to implement a PR, we are more than happy to help you go through the process.

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

SneakingSlayer avatar Mar 14 '23 05:03 SneakingSlayer

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

Luise8 avatar Dec 21 '23 13:12 Luise8

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

negative.

SneakingSlayer avatar Dec 21 '23 13:12 SneakingSlayer

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":
          },
        },              
      },

Luise8 avatar Dec 21 '23 14:12 Luise8