-
-
Notifications
You must be signed in to change notification settings - Fork 78
clickAnnotation does not work? Or I use it wrong way? #160
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
Comments
@Zahovay not sure if is an Source: plotly/plotly.js#1750 (comment) |
@andrefarzat Thanks for your quick reply, I tried captureevents: true as well as adding editable:true as well as adding both, but this only makes the cursor change when hovering over the annotation text. Just to be sure I put the options where you think, it is now this:
But does not trigger the clickAnnotation event when I click. |
@Zahovay I created a quick demo here and could make it work (see image:) Here is the code I used: import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.css']
})
export class AppComponent {
title = 'demo';
public annotation = {
text: 'Just a text',
x: 0,
y: 0,
arrowcolor: 'blue',
arrowhead: 20,
captureevents: true,
editable: true,
font: { size: 12 },
ay: -73
}
public graph = {
data: [
{ x: [1, 2, 3], y: [2, 6, 3], type: 'scatter', mode: 'lines+points', marker: { color: 'red' } },
{ x: [1, 2, 3], y: [2, 5, 3], type: 'bar' },
],
layout: { width: 320, height: 240, title: 'A Fancy Plot', annotations: [this.annotation] }
};
public onClickAnnotation(event: any) {
console.log('onClickAnnotation', event);
}
public onClick(event: any) {
console.log('onClick', event);
}
} <plotly-plot [data]="graph.data" [layout]="graph.layout" (clickAnnotation)="onClickAnnotation($event)" (plotlyClick)="onClick($event)"></plotly-plot> I am using angular 11.x , angular-plotly.js 4.x and PlotlyViaCDNModule with |
Alright, changing to PlotlyViaCDNModule it simply works.
This example on the front page does not work.(FYI) |
@Zahovay we do have issues with the regular |
I think I use something the wrong way, because everything else is working. This way plotlyclick is getting triggered when I click on any annotation I put on screen. Even when I try to click on annotations. Basically annotations are not clickable?
Angular version ~11
The text was updated successfully, but these errors were encountered: