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: 'Quarter' }, { name: 'Change' } ], datatype: 'csv', url: 'us_gdp_2008-2013.csv' }; this.state = { description: '(source: Bureau of Economic Analysis)', padding: { left: 10, top: 5, right: 10, bottom: 5 }, seriesGroups: [ { series: [ { // Modify this function to return the desired colors. // jqxChart will call the function for each data point. // Sequential points that have the same color will be // grouped automatically in a line segment colorFunction: (value: any, itemIndex: any, serie: any, group): any => { return (value < 0) ? '#CC1133' : '#55CC55'; }, dataField: 'Change', displayText: 'Change', toolTipFormatFunction: (value: any, itemIndex: any, serie: any, group: any, categoryValue: any, categoryAxis: any) => { return '