Skip to content
This repository was archived by the owner on Nov 25, 2021. It is now read-only.

Commit ac509e0

Browse files
authored
Move condition before loop
Minor fix; don't enter inot the foreach loop if not needed Link to #12
1 parent 3211b36 commit ac509e0

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

src/plugin.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,11 +188,13 @@ const ErrorBarsPlugin = {
188188

189189
// map error bar to barchart bar via label property
190190
barchartCoords.forEach((dataset, i) => {
191+
var hidden = chart.data.datasets[i]._meta[0].hidden
192+
if (hidden) {
193+
return;
194+
}
195+
191196
dataset.forEach((bar) => {
192-
var hidden = chart.data.datasets[i]._meta[0].hidden
193-
if (hidden) {
194-
return;
195-
}
197+
196198

197199
let cur = errorBarCoords[i];
198200
if (!cur) {

0 commit comments

Comments
 (0)