import * as React from 'react'; import JqxChart, { IChartProps, jqx } from 'jqwidgets-scripts/jqwidgets-react-tsx/jqxchart'; class App extends React.PureComponent<{}, IChartProps> { constructor(props: {}) { super(props); const source: any = { datafields: [ { name: 'Browser' }, { name: 'Share' } ], datatype: 'csv', url: 'desktop_browsers_share_dec2011.txt' }; this.state = { description: '(source: wikipedia.org)', padding: { left: 5, top: 5, right: 5, bottom: 5 }, seriesGroups: [ { series: [ { centerOffset: 0, dataField: 'Share', displayText: 'Browser', formatSettings: { sufix: '%', decimalPlaces: 1 }, initialAngle: 15, labelRadius: 120, radius: 170 } ], showLabels: true, type: 'pie' } ], source: new jqx.dataAdapter(source, { async: false, autoBind: true, loadError: (xhr: any, status: any, error: any) => { alert('Error loading "' + source.url + '" : ' + error); } }), title: 'Desktop browsers share', titlePadding: { left: 0, top: 0, right: 0, bottom: 10 } }; } public render() { return ( ); } } export default App;