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

Method clearChart

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

Source from the content-addressed store, hash-verified

147 }
148
149 clearChart()
150 {
151 if((this.props.type+"").trim()=="line")
152 {
153 this.state.chart.data = {
154 labels: [],
155 datasets: []
156 };
157 }
158 else
159 {
160 this.state.chart.data = {
161 labels: [],
162 datasets: [{
163 data:[],
164 backgroundColor: []
165 }]
166 };
167 }
168
169 this.state.chart.update();
170 }
171
172 render() {
173 return <canvas id={this.props.id} width="100%" height="100%" style={{width:"100%", height:"100%"}}></canvas>;

Callers 1

RunMethod · 0.80

Calls 1

updateMethod · 0.80

Tested by

no test coverage detected