Sha256: cb8a3b11a8cf0fea4a0c5cf217c41d5291a9eb245c71670f0369b6e21b44c2a4
Contents?: true
Size: 1.63 KB
Versions: 38
Compression:
Stored size: 1.63 KB
Contents
/* @flow */ import React from 'react' import classnames from 'classnames' import { globalProps } from '../utilities/globalProps.js' import pbChart from '../plugins/pb_chart' type LineGraphProps = { axisTitle?: string, xAxisCategories: array, yAxisMin: number, yAxisMax: number, className?: string, chartData: array<{ name: string, data: array<number>, }>, gradient?: boolean, id: string, pointStart: number, subTitle?: string, title: string, type?: string, legend?: boolean, toggleLegendClick?: boolean, height?: string, } export default class LineGraph extends React.Component<LineGraphProps> { static defaultProps = { className: 'pb_bar_graph', gradient: false, type: 'line', legend: false, toggleLegendClick: true, } componentDidMount() { const { axisTitle, xAxisCategories, yAxisMin, yAxisMax, className, chartData, id, pointStart, subTitle, title, type, legend, toggleLegendClick, height, } = 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: LineGraphProps render() { const { className, id } = this.props return ( <div className={classnames(globalProps(this.props), className)} id={id} /> ) } }
Version data entries
38 entries across 38 versions & 1 rubygems