2

I'm using ChartJS in my React application to render Bar chart with vertical bars and I need to display the label at the bottom of each bar but hide the vertical lines that come in between bars (ticks). Here is what I tried so far:

This does the opposite from what I want, it shows the ticks but not the labels:

xAxes : [ { display : true, // set this to false to hide the labels under the bars ticks: { display : false } }] 

This shows everything:

xAxes : [ { display : true, // set this to false to hide the labels under the bars maxTicksLimit: 0 }] 

Any suggestions?

2 Answers 2

1

How about setting the gridline display to false?

xAxes: [{ gridLines: {display:false} }] 

FIDDLE HERE

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

Comments

0

For Chartjs 2.9.3, you can use:

 xAxes: [{ gridLines: { drawTicks: false, } }] 

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.