1

enter image description here

I'm using charts in my react app. I tried using the Scales and gridlines: false option but it is not working from me. the image shows my code.

Thank you.

1
  • 2
    In the future, using code as text is preferred. Commented Jul 27, 2020 at 6:40

2 Answers 2

2

You might check a chart.js sample. From there I found some deviations in the object setup of your example

        var config = {
            type: 'line',
            data: {
                datasets: [{
                    // Here starts your snippet
                }]
            },
            options: {
                // The options are outside of the datasets property
                scales: {
                    x: {
                        gridLines: {
                          display: false
                        }
                    },
                    y: {
                        gridLines: {
                          display: false
                        }
                    }
                }
            }
        };

Edit 1: updated the scales with the gridLines property

Sign up to request clarification or add additional context in comments.

Comments

0

You can use below code to remove gridlines and if you want to enable X and Y axis its useful

 gridLines: {
                  display: true,
                  zeroLineColor:'white',
                  color:'transparent'
                }

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.