Sha256: 8e29ea54eefb4ed216f9dc1ba80ac6ac9286ada49d03e2e80e18d71ce3a5b69b
Contents?: true
Size: 1.19 KB
Versions: 15
Compression:
Stored size: 1.19 KB
Contents
/* @flow */ import React from 'react' import { pbChart } from '../' type BarGraphProps = { axisTitle: String, xAxisCategories: Array, yAxisMin: Number, yAxisMax: Number, chartData: Array<{ name: String, data: Array<Number>, }>, className?: String, id: Number, pointStart: Number, subTitle?: String, title: String, type?: String, } export default class BarGraph extends React.Component<BarGraphProps> { static defaultProps = { className: 'pb_bar_graph', type: 'column', } componentDidMount() { const { axisTitle, xAxisCategories, yAxisMin, yAxisMax, className, chartData, id, pointStart, subTitle, title, type, } = this.props new pbChart(`.${className}`, { axisTitle: axisTitle, chartData: chartData, id: id, pointStart: pointStart, subtitle: subTitle, type, title: title, xAxisCategories: xAxisCategories, yAxisMin: yAxisMin, yAxisMax: yAxisMax, }) } props: BarGraphProps render() { const { className, id } = this.props return ( <div className={className} id={id} /> ) } }
Version data entries
15 entries across 15 versions & 1 rubygems