0

I have built a graph of bar chart with some data. the current result I have is: enter image description here

and what I want is to delete the names below the xAxes in the bar chart. I viewed the react-chartjs-2 documentation and tried to change the options, also viewed Chart.Js documentation.

this is my options right now:

const options = { scales: { yAxes: [ { ticks: { beginAtZero: true, }, }, ], xAxes: [ { scaleLabel: { display: false, }, gridLines: { display: false, }, }, ], }, }; 
1
  • @Keith Undeleted it. I thought it was completly impossible so deleted it. Commented Jul 1, 2021 at 10:15

2 Answers 2

1

after a deep search I found the solution:

const options = { scales: { yAxes: [ { ticks: { beginAtZero: true, }, }, ], xAxes: { ticks: { display: false, }, }, }, 

The problem is in xAxes it was a list instead of object.

after the fix, this is how it looks:

enter image description here

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

Comments

0

This way you can hide it.

 const options = { indexAxis: 'y' as const, elements: { bar: { borderWidth: 0, }, }, scales: { x: { display: false }, y: { display: false } } } 

enter image description here

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.