Commit 0f537789 authored by Masayuki Tanaka's avatar Masayuki Tanaka

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

parent 1bc00786
...@@ -2716,23 +2716,20 @@ ...@@ -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++) { newData.push(selectedData[j]);
if (selectedData[j].id === id) { selectedData.shift(j);
newData.push(selectedData[j]); break;
selectedData.shift(j);
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); }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment