Browse Source

Fix error when mouse over with data.names - #197

pull/246/head
Masayuki Tanaka 11 years ago
parent
commit
0f537789bd
  1. 15
      c3.js
  2. 2
      c3.min.js

15
c3.js

@ -2716,23 +2716,20 @@
if (dragging) { return; } // do nothing if dragging if (dragging) { return; } // do nothing if dragging
if (hasArcType(c3.data.targets)) { return; } if (hasArcType(c3.data.targets)) { return; }
var selectedData = c3.data.targets.map(function (d) { return addName(d.values[i]); }); var selectedData = c3.data.targets.map(function (d) { return addName(d.values[i]); }),
var j, newData; newData = [];
// Sort selectedData as names order // Sort selectedData as names order
if (Object.keys(__data_names).length > 0) { Object.keys(__data_names).forEach(function (id) {
newData = []; for (var j = 0; j < selectedData.length; j++) {
for (var id in __data_names) { if (selectedData[j] && selectedData[j].id === id) {
for (j = 0; j < selectedData.length; j++) {
if (selectedData[j].id === id) {
newData.push(selectedData[j]); newData.push(selectedData[j]);
selectedData.shift(j); selectedData.shift(j);
break; break;
} }
} }
} });
selectedData = newData.concat(selectedData); // Add remained selectedData = newData.concat(selectedData); // Add remained
}
// Expand shapes if needed // Expand shapes if needed
if (__point_focus_expand_enabled) { expandCircles(i); } if (__point_focus_expand_enabled) { expandCircles(i); }

2
c3.min.js vendored

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save