Search code examples
javascriptdygraphs

dynamic highlight region should move along with data points when changes occur in dygraph


Is it possible to dynamic highlight points, for example data is 2015/08/09 10:55:46,-54., in -54 a point is plotted, I need a dynamic highlight on top and bottom say -54+10 = -44, -54-10 = -64.,.

So whenever new data is updated say 2015/08/10 10:55:46,-14., top +10 and bottom -10 i.e data point will be in center and its highlighted around it with +-10., so -14 will be center and highlight top will be -14 + 10 = -4 and for highlight bottom -14 - 10 = -24., gradually value will be updated and dynamic highlight also should move along with point.


Solution

  • Dygraphs has already a function for this. Your data must e.g. look like this:

    Date, Value1, Value2, Value3
    2015-9-16 14::,39;42;45,-3;0;3,16;19;22
    

    where for Value1 the real value = 42, bottom = 39 and top = 45 (can you change as needed, e.g. -10 or +10)

    enter image description here