chxj1992 / kline

一个 javascript K线插件. A K line library written in javascript.
Do What The F*ck You Want To Public License
793 stars 337 forks source link

FIX: fix toHeight to return 1.5 when value is Infinity #64

Closed liuzhishan closed 6 years ago

liuzhishan commented 6 years ago

根据range.js里180行: if (this._maxValue > this._minValue) this._ratio = (bottom - top) / (this._maxValue - this._minValue); 如果_maxValue为极大,_minValue为极小,则_ratio应该为0。 因此在toHeight函数中如果value为Infinity,则直接返回1.5,否则返回正常情况下的 Math.floor(value * this._ratio + 1.5);

chxj1992 commented 6 years ago

非常感谢