@stamen/horizontaldiscretebarchart

0.2.0 • Public • Published

HorizontalDiscreteBarChart

A simple horizontal bar chart.

Part of the @stamen/panorama toolkit.

Usage

import React from 'react';
import ReactDOM from 'react-dom';
import { HorizontalDiscreteBarChart } from '@panorama/toolkit';

let horizontalBarChartConfig = {
  data: [
    { animal: 'dogs', amount: 20 },
    { animal: 'cats', amount: 40 },
    { animal: 'spiders', amount: 10 }
  ],
  width: 600,
  height: 200,

  // Optionally specify custom margins
  margin: { top: 10, right: 10, bottom: 10, left: 10 },

  // Optionally specify accessors to match your data format
  xAccessor: d => d.amount,
  yAccessor: d => d.animal
};

ReactDOM.render(<HorizontalDiscreteBarChart {...horizontalBarChartConfig}/>, document.body);

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i @stamen/horizontaldiscretebarchart

    Weekly Downloads

    0

    Version

    0.2.0

    License

    ISC

    Last publish

    Collaborators

    • ericsoco
    • mojodna
    • stamen