mirror of
https://github.com/chartjs/Chart.js.git
synced 2025-12-08 20:36:08 +00:00
Draw active points last (#6944)
This commit is contained in:
parent
8d7d5571cf
commit
547aa51544
@ -164,16 +164,26 @@ export default DatasetController.extend({
|
||||
const meta = me._cachedMeta;
|
||||
const points = meta.data || [];
|
||||
const area = chart.chartArea;
|
||||
const ilen = points.length;
|
||||
let i = 0;
|
||||
const active = [];
|
||||
let ilen = points.length;
|
||||
let i, point;
|
||||
|
||||
if (me._showLine) {
|
||||
meta.dataset.draw(ctx, area);
|
||||
}
|
||||
|
||||
|
||||
// Draw the points
|
||||
for (; i < ilen; ++i) {
|
||||
points[i].draw(ctx, area);
|
||||
for (i = 0; i < ilen; ++i) {
|
||||
point = points[i];
|
||||
if (point.active) {
|
||||
active.push(point);
|
||||
} else {
|
||||
point.draw(ctx, area);
|
||||
}
|
||||
}
|
||||
for (i = 0, ilen = active.length; i < ilen; ++i) {
|
||||
active[i].draw(ctx, area);
|
||||
}
|
||||
},
|
||||
});
|
||||
|
||||
@ -1006,6 +1006,7 @@ helpers.extend(DatasetController.prototype, {
|
||||
* @private
|
||||
*/
|
||||
_setStyle(element, index, mode, active) {
|
||||
element.active = active;
|
||||
this._resolveAnimations(index, mode, active).update(element, {options: this.getStyle(index, active)});
|
||||
},
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user