(onClick)
| 3005 | // The hover colour is less opaque than the normal one, so an un-hover |
| 3006 | // animation that takes over the hide animation makes the line more opaque. |
| 3007 | function acquireLineChart(onClick) { |
| 3008 | const chart = acquireChart({ |
| 3009 | type: 'line', |
| 3010 | data: { |
| 3011 | labels: ['a', 'b', 'c'], |
| 3012 | datasets: [{ |
| 3013 | data: [1, 2, 3], |
| 3014 | borderColor: 'rgba(255, 0, 0, 0.9)', |
| 3015 | hoverBorderColor: 'rgba(255, 0, 0, 0.5)', |
| 3016 | }, { |
| 3017 | data: [3, 2, 1], |
| 3018 | }] |
| 3019 | }, |
| 3020 | options: { |
| 3021 | animation: {duration: 1000}, |
| 3022 | interaction: {mode: 'dataset', intersect: false}, |
| 3023 | transitions: {active: {animation: {duration: 0}}}, |
| 3024 | onClick |
| 3025 | } |
| 3026 | }); |
| 3027 | // End the initial animation, which a hover would otherwise retarget. |
| 3028 | chart.stop(); |
| 3029 | return chart; |
| 3030 | } |
| 3031 | |
| 3032 | // The border colour of the line half way through the hide animation. |
| 3033 | function borderAlphaAtMidHide(line) { |
no test coverage detected