Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var point = data.points[0].x;
- var counter = 0;
- $(".menuOption").click(function () {
- console.log(counter);
- counter++;
- var code = $(this).attr('id');
- var text = $(this).html();
- var newLine = {
- type: 'line',
- x0: point,
- x1: point,
- y0: 0,
- y1: 1,
- yref: 'paper',
- line: {
- color: 'black',
- width: 1
- },
- name: text
- };
- var annotation = {
- x: point,
- y: data.points[0].y,
- xref: 'x',
- yref: 'y',
- text: code,
- textangle: 90,
- showarrow: true,
- arrowhead: 7
- }
- Plotly.relayout("grap", {
- 'shapes[0]': newLine,
- 'hovermode': 'closest',
- 'annotations[0]': annotation
- });
- });
- https://codepen.io/dmance/pen/mMdXqG
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement