Using Protovis, I generate a candlestick chart similar to this: http://vis.stanford.edu/protovis/ex/candlestick-full.html. I need to annotate the chart for a specific candlestick. For instance, I could draw triangle at the position of the 12:00 candlestick. How do I find the position (left and bottom) of that specific candlestick?
Using Protovis, I generate a candlestick chart similar to this: http://vis.stanford.edu/protovis/ex/candlestick-full.html . I need
Share
I believe the standard protovis approach to this is to make the annotation mark a child mark of the data point you’re interested in, then set its
visibleproperty to only display for the data point you’re interested in. For the candlestick example, it might look like this:The other option, if you need to get the data outside of the protovis context (e.g. you want to show a
divthere with HTML text) would be to grab the data as it’s being defined (e.g. in thebottomandheightproperty functions of thecandlestickdefinition) and store it in a global variable. This is pretty ugly, though.