1.0.3 • Published 6 months ago

simple-funnel-chart v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

simple-funnel-chart

Simple Funnel Chart on React

NPM JavaScript Style Guide

Sample

Simple Funnel Chart on React

Install

npm install --save simple-funnel-chart

Usage

import React from 'react'

import { Funnel } from 'simple-funnel-chart'
import 'simple-funnel-chart/dist/index.css'

const data = [
  { value: 100, name: 'Leads' },
  { value: 70, name: 'Calls' },
  { value: 50, name: 'Meetings' },
  { value: 10, name: 'Sales' }
];

const App = () => {
  return <Funnel
    data={data}
    width={250}
    hideLegend={false}
    rowHeight={20}
    onRowClick={(item) => alert(item.name + ' ' + item.value)}
    fontSize={'14px'}
    marginText={'-20px'}
  />
}

export default App

Properties

NameTypeRequiredDefaultDescription
dataArrayTrueArray of values { value: 0, name: 'Name' }
widthIntFalse500Funnel width
hideLegendBoolFalseFalseHide legend
rowHeightIntFalse20Row height
onRowClickFunctionFalseA function that is called when a row is clicked; an object with the value and name of the row is passed as a parameter
fontSizeStringFalse"14px"Font size
marginTextStringFalse"-20px"Margin for text, may be required at different font sizes

License

MIT © nekiyl1

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago