Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/assets/js/reprodb-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,13 @@
R.initEChart = function(el) {
if (typeof el === 'string') el = document.getElementById(el);
if (!el) return null;
// Dispose any existing instance on this element so re-renders start from
// a clean slate. echarts.init otherwise returns the existing instance, and
// a subsequent setOption() merges by default — leaving stale series/data
// (e.g. a previous profile's "AE Committee Service" bars) behind when
// switching between people on the profile page.
var existing = echarts.getInstanceByDom(el);
if (existing) existing.dispose();
var chart = echarts.init(el, null, { renderer: 'canvas' });

// Wrap setOption so every call automatically re-applies theme text
Expand Down