| | |
| | | ] |
| | | }, |
| | | |
| | | // _custom: [ |
| | | // [0.05, 0.9, 0.03, 0.75], |
| | | // [0.3, 0.65, 0.02, 0.75], |
| | | // [0.87, 0.92, 0.03, 0.75], |
| | | // [0.8, 0.67, 0.04, 0.75], |
| | | // [0.92, 0.28, 0.07, 0.75], |
| | | // [0.6, 0.05, 0.05, 0.75] |
| | | // ], |
| | | _custom: [ |
| | | [0.05, 0.9, 0.03, 0.75], |
| | | [0.3, 0.65, 0.02, 0.75], |
| | | [0.87, 0.92, 0.03, 0.75], |
| | | [0.8, 0.67, 0.04, 0.75], |
| | | [0.92, 0.28, 0.07, 0.75], |
| | | [0.6, 0.05, 0.05, 0.75] |
| | | [0, 0.89, 0, 0.75], |
| | | [1, 1, 0, 0.75], |
| | | [1, 0.49, 0, 0.75], |
| | | [1, 0, 0, 0.75], |
| | | [0.6, 0, 0.3, 0.75], |
| | | [0.49, 0, 0.14, 0.75] |
| | | ], |
| | | |
| | | getStandardRange: function (name) { |
| | |
| | | colors = this._legend_c[name]; |
| | | } else { |
| | | colors = this._custom; |
| | | } |
| | | if (colors == undefined) { |
| | | colors = this._legend_c['PM25']; |
| | | } |
| | | let index = colors.indexOf(color); |
| | | index--; |
| | |
| | | |
| | | getCustomColor: function (data, min, max) { |
| | | var per = (max - min) / this._custom.length; |
| | | var i = parseInt(data / per); |
| | | var i = parseInt((data - min) / per); |
| | | if (i >= this._custom.length) { |
| | | i = this._custom.length - 1; |
| | | } |