Using HTML in Annotations

66 views
Skip to first unread message

shreds

unread,
Nov 11, 2013, 5:27:20 PM11/11/13
to dygraph...@googlegroups.com

Under the Google charts visualization, there is an "allowHTML" option that allows for placing HTML tags inside annotation descriptions. Is there something similar in Dygraphs where the annotation allows anHREF tag that allows the user to link to another web page?

For example, a stock chart shows a split on a specific date. The annotation, on click, would bring up the press release announcing the split. The description field would be in HTML and include the appropriateHREF anchor to the press release?


I posted in stack overflow but was hoping to get a more specific response here.  I've been looking at a variety of annotated timeline options, and Dygraphs seems the most versatile in bringing in data from various formats, but doesn't seem to have an option for using HREF anchors as part of annotations.  Is it possible I just missed something in the support materials?

Dan Vanderkam

unread,
Nov 12, 2013, 10:11:12 AM11/12/13
to dygraph...@googlegroups.com
The built-in annotations are purely text -- no HTML allowed. I worked on a more sophisticated annotations plugin earlier this year which I'd like to push to the open source repo soon. I'll keep everyone posted.

In the meantime, if you need to hack something up, you can modify this line in plugins/annotations.js:
      div.appendChild(document.createTextNode(p.annotation.shortText));

 - Dan


--
You received this message because you are subscribed to the Google Groups "dygraphs-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dygraphs-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Raghav Vajjhala

unread,
Mar 30, 2014, 4:36:15 PM3/30/14
to dygraph...@googlegroups.com
Dan,

Any idea on when the update might be available on use of HREF tags in the annotations?

Just curious - have been working on some data sets that I'd like to start using with that feature in place.

Thanks again for all the great work you've done.

Raghav


--
You received this message because you are subscribed to a topic in the Google Groups "dygraphs-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/dygraphs-users/S9kyVzMeS1A/unsubscribe.
To unsubscribe from this group and all its topics, send an email to dygraphs-user...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages