-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Doesn't work with chart.js 2.7.x #10
Comments
This seems to ultimately be a problem with the annotations plugin. Please see my post on that issue to understand what I believe the root cause is. I was able to get around this problem by doing the following. .
The above seems to give the draggable plugin a working chart instance and dragging starts to work. Please note that this shouldn't be considered a permanent fix, only a work around until the author of this plug is able to get a fix in place. |
Quick update for those that care. I have likely tracked this bug to ChartJS. I have filed a bug/question to the chartjs team to see what direction they want to go. Please refer to this thread. chartjs/Chart.js#5111 |
Hi, I got it working with Chart.js 2.9.3, you just have to add an id to the annotation, like so: annotation: {
drawTime: "afterDraw",
events: ["click"],
annotations: [
{
id: "line1",
type: "line",
mode: "vertical",
scaleID: "x-axis-0",
value: 3,
borderColor: "red",
borderWidth: 2,
draggable: true,
onDragEnd: function() {
console.log(this.value);
}
}
]
} Here's a working pen: https://codepen.io/juxtar/pen/jOEpWRB |
Hey @juxtar, Best, |
Yep, still works for me with Chrome 89. |
Alright, thanks @juxtar! |
Samples do not work with chart.js 2.7.x
The text was updated successfully, but these errors were encountered: