MCPcopy Create free account
hub / github.com/docusealco/docuseal / initChart

Method initChart

app/javascript/elements/bar_chart.js:16–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 }
15
16 async initChart () {
17 const { default: Chart } = await import(/* webpackChunkName: "chartjs" */ 'chart.js/auto')
18
19 const canvas = this.querySelector('canvas')
20
21 const ctx = canvas.getContext('2d')
22
23 this.chartInstance = new Chart(ctx, {
24 type: 'bar',
25 data: {
26 labels: this.chartLabels,
27 datasets: this.chartDatasets
28 },
29 options: {
30 responsive: true,
31 maintainAspectRatio: true,
32 animation: false,
33 scales: {
34 y: {
35 beginAtZero: true,
36 grace: '20%',
37 ticks: {
38 precision: 0
39 }
40 }
41 },
42 plugins: {
43 legend: {
44 display: false
45 }
46 }
47 }
48 })
49 }
50}

Callers 1

connectedCallbackMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected