🏠 back to Observable

Zoomable Linecharts with Opentip and V6

Hi all,
I’m new to both JS and D3 (not a great combo, but it’s my job now so…) and I’m trying to do a line chart that has both a moving tooltip (using Opentip) AND can be zoomed.

I’ve got everything but the zoom to work. I’m working within an established framework, so I’m constrained with what I can and can’t do and trying to get the code to work OUTSIDE of that framework to isolate examples is kind of a nightmare.

The first zoom technique I tried was the brushing. Unfortunately because both opentip and the brush require their own overlay in order to work right, they won’t work together. And attaching opentip AND the brush to the same overlay didn’t seem to work either.

I found this great example (Line chart with zoom - bl.ocks.org) on zooming a line chart but of course, it doesn’t work in V6, only V5. I like the way the code for this chart is laid out as it’s pretty easy to understand. Anyone know of any examples for V6 for a zoomable line chart?


This might be of some help: Tooltips in Zoomable Map

Not really, no. I’m using opentip and don’t have the option to use something else. Thanks though.