Vertical annotation with float values do not display
See original GitHub issueHello 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:
- Created 5 years ago
- Comments:5
Top 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 >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
My bad, I needed to put the annotations in the “options” object. It works now.
Can you make a fiddle with the code you are using now? Maybe I can help