Welcome aboard! We are happy you are here and wish you good net-raft!
// you must install npm install canvasjs
/*App.js*/
import React, { Component } from 'react';
import CanvasJS from 'canvasjs';
class App extends Component {
setStateHandler() {
var chart = new CanvasJS.Chart("chartContainer", {
theme: "light2",
animationEnabled: true,
exportEnabled: true,
title:{
text: "Your Title"
},
data: [{
type: "pie",
startAngle: 45,
yValueFormatString: "#,##0.0#\"%\"",
dataPoints: [
{ y: 1.1, label:"Angularjs" },
{ y: 3.85, label:"React" },
{ y: 5.53, label:"VueJs" },
{ y: 6.46, label:"jQuery" },
{ y: 5.23, label:"Angular" },
]
}]
});
chart.render();
}
render() {
return (
<div className="App">
<div id="chartContainer"></div>
</div>
);
}
}
export default App;
The most helpful REACT solutions
How to get client ip address using react ?REACT Click to see more ... 19.2K 421