(context)
| 1 | const getGradient = (context) => { |
| 2 | const {chart, p0, p1} = context; |
| 3 | const ctx = chart.ctx; |
| 4 | const {x: x0} = p0.getProps(['x'], true); |
| 5 | const {x: x1} = p1.getProps(['x'], true); |
| 6 | const gradient = ctx.createLinearGradient(x0, 0, x1, 0); |
| 7 | gradient.addColorStop(0, p0.options.backgroundColor); |
| 8 | gradient.addColorStop(1, p1.options.backgroundColor); |
| 9 | return gradient; |
| 10 | }; |
| 11 | |
| 12 | module.exports = { |
| 13 | config: { |