MCPcopy Create free account
hub / github.com/chartjs/Chart.js / acquireLineChart

Function acquireLineChart

test/specs/core.controller.spec.js:3007–3030  ·  view source on GitHub ↗
(onClick)

Source from the content-addressed store, hash-verified

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) {

Callers 1

Calls 1

stopMethod · 0.65

Tested by

no test coverage detected