var pB=[]; //later I have assigned **plotBands: pB,**
pB[i]={
from:tA[i],
to: tA[i+1],
label: {
text: wA[i], // Content of the label.
align: 'center'},
color: '#eef',
events: {
click: function(){
console.log("from: "+this.from);
console.log("duration: "+this.(to-from));
}
}
}
我想在每个pB [i]中访问上例中的 from 值。我怎么做 ? 来自有一个数值。enter code here
console.log(“from:”+ this.from); 输出“undefined”。