billboard.js icon indicating copy to clipboard operation
billboard.js copied to clipboard

Zoom and subchart do not work together

Open typingtanuki opened this issue 6 years ago • 7 comments

Description

In C3 zooming using the mouse wheel would update the subchart greay area to reflect the zoomed area. Also selecting an area in the subchart will prevent mouse wheel zoom to work until a tooltip pops up.

Steps to check or reproduce

  • Open the following sample: https://codepen.io/anon/pen/vWdoLY
    • Select an area in the subchart
    • Move mouse in the chart area without triggering any tooltip and roll the mouse wheel
      • → No zoom will occur
    • Move the mouse in the chart until a tooltip shows up and roll the mouse wheel again
      • → Zoom will occur but the grey area in the subchart will not update
    • Use the "left click + move mouse left/right" to move the chart
      • → Chart will move but the grey area in the subchart will not follow

typingtanuki avatar Nov 21 '17 07:11 typingtanuki

C3 depends on D3 v3.x and billboard.js depends on D3 v4+, which has changed a lot without the backward compatibility. The zooming functionality depends on D3's zoom API which doesn't behave exactly same as v3.x.

I'll try look what can be done, but it could take time to solve. Because the conversion of zoom API from v3 to v4 was the hardest one.

netil avatar Nov 21 '17 08:11 netil

Thank you for your work! With some improvements this may become most popular chart drawing module.

+1 for this functionality. Actually ,this is the only reason why I can not use this module in the production.

jmijmi avatar Mar 16 '18 17:03 jmijmi

+1 for this fix!

I'd also like to point out that resizing does not update the grey area in the subchart as well!

Thanks for the awesome work!

irislieuw avatar May 11 '18 01:05 irislieuw

+1

brattpurrie avatar Jun 25 '18 08:06 brattpurrie

+1 Facing a similar issue. Had to disable zoom in Main chart, when sub chart is enabled, as a workaround.

nirmal93guna avatar Oct 08 '19 06:10 nirmal93guna

+1 My use case involves a time series chart that allows the user to pan/zoom on the data. While this is possible with just the subchart, it feels far more natural to drag and scroll on the chart directly while having the subchart there as more of a "minimap" or large adjustments.

ebencollins avatar Jan 24 '21 07:01 ebencollins

+1

jimmy764 avatar Jun 07 '21 13:06 jimmy764