Sha256: af75ab967607663989aef79829dac8cd59adb70e5a24e722107193c203833cbe

Contents?: true

Size: 1.18 KB

Versions: 11

Compression:

Stored size: 1.18 KB

Contents

/* @flow */

import React from "react"

import {pbChart} from "../"

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

export default class LineGraph extends React.Component<LineGraphProps> {
    static defaultProps = {
        className: 'pb_bar_graph',
        gradient: false,
        type: 'line',
    }

    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: LineGraphProps

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

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

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
playbook_ui-3.1.0 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-3.0.1 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-3.0.0 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-2.9.9 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-2.9.8 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-2.9.7 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-2.9.6 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-2.9.5 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-2.9.4 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-2.9.3 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx
playbook_ui-2.9.2 app/pb_kits/playbook/pb_line_graph/_line_graph.jsx