Add legend={true}
, title="Any title"
for legend and title.
Data will be in this format -[
{label: 'Apples', value: 10, color: '#FD9827'},
{....},
{....}
]
<PieChart data={data} title="Sample Fruits"/>
<PieChart data={data} title="Sample Fruits" legend={true}/>
<Donut data={data} title="Sample Fruits" />
<Donut data={data} title="Sample Fruits" legend={true} />
Add xaxis={true}
, yaxis={true}
, xgrid={true}
, or ygrid={true}
for axis and grids.
Bar with individual colors will need data in this format -[
{label: 'Apples', value: 10, color: '#FD9827'},
{....},
{....}
]
<BarChart data={data} color="cornflowerblue"/>
<BarChart data={data}/>
Add title="Any title"
for title.
Data will be in below format -[
[int, int],
[int, int],
[int, int]
]
You may pass the style attributes in below format -
{
width : 500,
height : 300,
padding : 30,
}
<ScatteredPlot {...this.state} {...styles} title="Scattered Plot" />
Add xaxis={true}
, yaxis={true}
, xgrid={true}
, or ygrid={true}
for axis and grids.
Data for Line chart -
[
{ 'data': [ { x: 0, y: 20 }, { ... }, { .... }], 'label': 'series1', 'color': '#FD9827' },
{....},
{....}
]
Data for Time series Line chart -
[
{x:'02-11-2016', y:180},
{x:'02-12-2016', y:250},
{....}
]
<LineChart data={singleLineData} />
<LineChart data={multipleLineData} />
<LineChart data={multipleLineData} axisX={true} axisY={true}/>
<LineChart data={multipleLineData} gridX={true} gridY={true}/>
<LineChart data={multipleLineData} axisX={true} axisY={true} gridX={true} gridY={true}/>
<TimeSeriesLineChart data={timeSeriesLineData} />