React PieChart - JSON Data

To bind the PieChart to data in a JSON format, assign the data's URL to the dataSource property.

App.js
  • import PieChart from 'devextreme-react/pie-chart';
  •  
  • export default function App() {
  • return (
  • <PieChart dataSource="http://www.example.com/dataservices/data.json">
  • {/* ... */}
  • </PieChart>
  • );
  • }

Note that you can also use a JSONP callback parameter.

App.js
  • import PieChart from 'devextreme-react/pie-chart';
  •  
  • export default function App() {
  • return (
  • <PieChart dataSource="http://www.example.com/dataservices/jsonpdata?callback=?">
  • {/* ... */}
  • </PieChart>
  • );
  • }

If you need to process data after obtaining it, implement the CustomStore. For details, see the Custom Sources topic.

See Also