Sha256: d155d54511525b989421f0877b86e080575643c27bf5efb58d2c71e9d07c515c
Contents?: true
Size: 1.57 KB
Versions: 37
Compression:
Stored size: 1.57 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { pbChart } from '../' import { globalProps } from '../utilities/globalProps.js' 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, legend?: boolean, toggleLegendClick?: boolean, height?: string, } export default class BarGraph extends React.Component<BarGraphProps> { static defaultProps = { className: 'pb_bar_graph', type: 'column', legend: false, toggleLegendClick: true, } componentDidMount() { const { axisTitle, xAxisCategories, yAxisMin, yAxisMax, className, chartData, id, pointStart, subTitle, title, type, legend, height, toggleLegendClick, } = this.props new pbChart(`.${className}`, { axisTitle: axisTitle, chartData: chartData, id: id, pointStart: pointStart, subtitle: subTitle, type, title: title, xAxisCategories: xAxisCategories, yAxisMin: yAxisMin, yAxisMax: yAxisMax, legend: legend, toggleLegendClick: toggleLegendClick, height: height, }) } props: BarGraphProps render() { const { className, id } = this.props return ( <div className={classnames(className, globalProps(this.props))} id={id} /> ) } }
Version data entries
37 entries across 37 versions & 1 rubygems