c3js / c3

:bar_chart: A D3-based reusable chart library
http://c3js.org
MIT License
9.35k stars 1.39k forks source link

Transition of main chart does not work with subchart selection #2757

Open dmitrystas opened 4 years ago

dmitrystas commented 4 years ago

When subchart is selected animation effect for main chart does not work

Mshardul commented 4 years ago

Works fine for me. Can you please elaborate, and provide the code (if possible).

dmitrystas commented 4 years ago

d3 v5.15.0 + c3 v0.7.12

https://jsfiddle.net/dmitry_stas/zekauw9g/4/

  1. try to on/off data1 - animation works fine
  2. select any range on subchart
  3. try to on/off data1 - animation works for subchart, but not for main chart
Mshardul commented 4 years ago

Everything seems to work here. I even added 'zoom' to your fiddle. And it worked properly (along with the drag event). Can you please tell me which animation in particular, is not working for you? https://jsfiddle.net/mshardul/uk6sbrpL/

dmitrystas commented 4 years ago

When I enable/disable data1 (by clicking on "data1" block on a legend area) the main chart hides/shows data1 line and rebuilds height of data2 line with animation. It works ok when no range selected on subchart. But when I select any range on subchart this animation does not work, the height of data2 line just switches without animation

  1. Try to click 3-4 times on data1 (on legend area) and look at the yellow data2 on main chart (animation works fine)
  2. select full range (from start to end) on subchart
  3. repeat step 1 - animation of line height does not work