charts-lib-arpit v0.6.1
Charts Lib
charts-lib is a simple library to plot charts in React.
Bar Charts
A bar chart can be plotted using the following format
<BarChart
divisions={10}
minValue={0}
maxValue={100}
height="400px"
dataPoints={[
[{
label: 'A',
value: 60,
},
{
label: 'B',
value: 100,
}],
[{
label: 'A',
value: 82,
},
{
label: 'B',
value: 99,
}]
]}
/>
The parameters for the BarChart object are as follows:
dataPoints: BarChartItem This is the list of data points. It is a 2D array of BarChartItem which consists of the following parameters.
interface BarChartItem {
label: string;
value: number;
color?: string;
}
The optional parameter color
can be used if we want to do different colors than the ones provided.
height: string Height takes a string parameter for the entire chart. The heights of the bars are calculated as a percentage of this height.
minValue: number Takes in a number for the maximum value in the BarChartItem
class.
maxValue: number Takes in a number for the minimum value in the BarChartItem
class.
divisions: number Number of divisions we want to see in our chart (still under development).