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

Version Path
playbook_ui-4.15.0 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.14.0 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.15.1.alpha1 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.13.1 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.13.0 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.12.0 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.11.0 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.11.0.pre.alpha3 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.11.0.pre.alpha.pre.2 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.10.0 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.10.0.pre.alpha1 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.9.0.pre.alpha1 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.9.0 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.8.2 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-4.8.1 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx