question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Chart js Annotation label cuts off when positioned to the right

See original GitHub issue

The chart js annotation label seems to cut off the canvas when aligned to the right side of the chart. I tried adding Padding but that does not seem to work.

Here is what i mean: image

Are there any configurations I can use to align the label on the right side without cutting off text?

Here is my annotation configs:

label: { backgroundColor: 'rgba(0,0,0,0)', enabled: true, content: 'Avg', position: 'right', xAdjust: -15, Thanks!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:9 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
tobiasbueschelcommented, Feb 18, 2019

Hi @sdaniel1609 & @chrisokamoto 👋,

I ran into the same issue and “solved it” (in a hacky way) by offsetting the label using xAdjust depending on whether it was the first or last element in the column.

Here is a JsFiddle that explains what I mean: https://jsfiddle.net/Lq473vx9/

Would be great if this plugin would handle such situations! @etimberg what do you think?

2reactions
Githamzacommented, Feb 27, 2019

Looking for a solution also, if it’s possible to put the label z-index > to graph

Read more comments on GitHub >

github_iconTop Results From Across the Web

chart js annotation label text is cutting of - Stack Overflow
i need to show my label text at bottom of the graph i mean outside the graph, right now for me going inside...
Read more >
Label Annotations | chartjs-plugin-annotation
Label annotations are used to add contents on the chart area. This can be useful for describing values that are of interest. options...
Read more >
Chart.Js - Problem With Label On The Right Hand - ADocLib
The chart js annotation label seems to cut off the canvas when aligned to the right side of the chart. I tried adding...
Read more >
How to Add Custom Data Labels at Specific Position in Chart JS
With the chartjs -plugin-datalabels or the chartjs datalabels plugin you can only position the data labels a few pixel above the bar or...
Read more >
How to Add Custom Annotation Line on Hover in Chart JS
How to Add Custom Annotation Line on Hover in Chart JSTo add a custom annotation line on hover in Chart JS we need...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found