Vue-chartjs: How to remove the rectangle at the top?

Created on 6 Jan 2018  ·  5Comments  ·  Source: apertureless/vue-chartjs

Great component.
Just one thing.
I prefer to have my own label - to better manage translation - and put it just above of the component.

But I need to remove the preset label.
To remove the text I can easily set the label property to ''.
But I didn't manage to remove the rectangle at the top.
How can I do that?

Thanks!

❓ question

Most helpful comment

In your chart options set legend.display to false.

this.renderChart(this.data, { legend: { display: false } })

see documentation: http://www.chartjs.org/docs/latest/configuration/legend.html

All 5 comments

I don't really know what you mean 🙈
Are you talking about the legend?

Yes exactly.
Sorry for my english 😅

In your chart options set legend.display to false.

this.renderChart(this.data, { legend: { display: false } })

see documentation: http://www.chartjs.org/docs/latest/configuration/legend.html

Thanks @AlexRudd it works!

Maybe some useful docs from chart.js should be included or referenced in vue-chartjs docs?

Well, I don't want to copy paste the whole chart.js docs.
The vue-chartjs docs contain only very specific usages of vue-chartjs which are tailored for usage with vue.

For general questions about how to make chart.js stuff, it's always better to lookup the official chart.js docs. As everything mentioned there will work with vue-chartjs.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

rzb picture rzb  ·  4Comments

bdeanindy picture bdeanindy  ·  3Comments

aido179 picture aido179  ·  3Comments

Tirke picture Tirke  ·  4Comments

Sykomaniac picture Sykomaniac  ·  3Comments