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.

Vertical annotation with float values do not display

See original GitHub issue

Hello there,

Made a new instance of issue #79, because that problem does exist. I ran into it to and I did some more investigation.

Turns out that this is caused by a function in the main repository which is called here: pixel = helpers.isValid(options.value) ? scale.getPixelForValue(options.value) : NaN;

The scale.getPixelForValue implementation has the following code:

var labels = me.getLabels();
value = valueCategory || value;
var idx = labels.indexOf(value);
index = idx !== -1 ? idx : index;`

Which as far as I can see it looks up the value (for instance 4.5) in the array of labels (for instance [1,2,3,4,5]) which of course fails.

So a solution would be to just do the calculations of the x-coordinate in this case in the plugin itself or get the function fixed in the main repository.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5

github_iconTop GitHub Comments

1reaction
chrisadamsonmcricommented, Nov 21, 2018

My bad, I needed to put the annotations in the “options” object. It works now.

0reactions
Evertvdwcommented, Nov 21, 2018

Can you make a fiddle with the code you are using now? Maybe I can help

Read more comments on GitHub >

github_iconTop Results From Across the Web

Decimal of float values for vertical annotations? · Issue #79
Floating point values should work fine with linear scales. See the samples in https://github.com/compwright/chartjs-plugin-draggable for a ...
Read more >
c# chart vertical text annotation
The solution that worked for me. First, add the annotation as usual. The key is to make it invisible and then draw it...
Read more >
Floating Annotations on Line Chart (For a Burnup chart)
I am trying to create a burnup chart in EazyBi and as part of this we need a way to viasualise key dates...
Read more >
Dashboard Body Structure and Syntax - Amazon CloudWatch
A horizontal or vertical annotation is not required. liveData. Specify true to display live data in the widget. Live data is data published...
Read more >
Visualization: Column Chart
A column chart is a vertical bar chart rendered in the browser using SVG or VML, whichever is ... but the axis values...
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