MCPcopy
hub / github.com/MrNothing/AI-Blocks / drawLines

Method drawLines

Sources/src/Model/UI/Modules/Chart.js:18–60  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

16 }
17
18 drawLines()
19 {
20 if(window.service.pending_charts[this.props.target])
21 {
22 let labels = [];
23 let datasets = [];
24
25 for (let u in window.service.pending_charts[this.props.target])
26 {
27 let pendingData = window.service.pending_charts[this.props.target][u][0];
28 for(let i in pendingData)
29 {
30 labels.push(i);
31 }
32 break;
33 }
34
35 for (let u in window.service.pending_charts[this.props.target])
36 {
37 let data = [];
38 let label = u;
39
40 let pendingData = window.service.pending_charts[this.props.target][u][0];
41
42 for(let i in pendingData)
43 {
44 data.push(pendingData[i]);
45 }
46
47 datasets.push({
48 data: data,
49 label: label,
50 borderColor: "#3e95cd",
51 fill: true
52 });
53 }
54
55 return {
56 labels: labels,
57 datasets: datasets
58 };
59 }
60 }
61
62 componentDidMount() {
63 let ctx = document.getElementById(this.props.id);

Callers 1

updateChartMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected