Sha256: 9c24b0625e0caca81d56e18d2a9c8ffb7591130fc104323cb5b6ff14712a4797

Contents?: true

Size: 1014 Bytes

Versions: 4

Compression:

Stored size: 1014 Bytes

Contents

/* @flow */

import React from 'react'

import pbChart from "../plugins/pb_chart_plugin.js"

type BarGraphProps = {
  axisTitle: String,
  chartData: Array<{
    name: String,
    data: Array<Number>,
  }>,
  className?: String,
  id: Number,
  pointStart: Number,
  subTitle?: String,
  title: String,
}

export default class BarGraph extends React.Component<BarGraphProps> {
  static defaultProps = {
    className: 'pb_bar_graph',
    type: 'column',
  }

  componentDidMount() {
    const {
      axisTitle,
      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,
    })
  }

  props: BarGraphProps

  render() {
    const { className, id } = this.props

    return (
      <div
          className={className}
          id={id}
      />
    )
  }
}

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
playbook_ui-2.9.1 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-2.9.0 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-2.8.9 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx
playbook_ui-2.8.8 app/pb_kits/playbook/pb_bar_graph/_bar_graph.jsx