1.0.22 • Published 6 months ago

react-funnel-chart-ts v1.0.22

Weekly downloads
-
License
ISC
Repository
-
Last release
6 months ago

React Funnel Chart Pro

A beautiful and customizable funnel chart component for React applications.

Screen shot

Funnel Chart sample

Features

  • 📊 Smooth animations and transitions
  • 🎨 Fully customizable colors and styles
  • 📱 Responsive design
  • 🔧 Configurable display options
  • 💡 Interactive tooltips
  • 📝 TypeScript support
  • 🎯 Only 1 dependencies

Buy Me a Coffee

Installation

npm install react-funnel-chart-ts
# or
yarn add react-funnel-chart-ts

Usage

import { FunnelChart } from 'react-funnel-chart-ts';

const data = [
  { label: 'Visitors', value: 5000, color: '#60A5FA' },
  { label: 'Interested', value: 2500, color: '#34D399' },
  { label: 'Prospects', value: 1200, color: '#A78BFA' },
  { label: 'Negotiations', value: 600, color: '#F472B6' },
  { label: 'Deals', value: 200, color: '#FBBF24' },
];

function App() {
  return (
    <FunnelChart
      data={data}
      height={500}
      width={800}
      showPercentages={true}
      showValues={true}
      showLabels={true}
      showLegend={true}
    />
  );
}

Props

PropTypeDefaultDescription
dataFunnelData[]requiredArray of data points for the funnel chart
heightnumber400Height of the chart in pixels
widthnumber600Width of the chart in pixels
showPercentagesbooleantrueShow percentage values
showValuesbooleantrueShow raw values
showLabelsbooleantrueShow labels
showLegendbooleantrueShow legend
showTooltipsbooleantrueShow tooltips on hover
formatValue(value: number) => stringvalue.toLocaleString()Custom value formatter
formatPercentage(percentage: number) => string`${percentage.toFixed(1)}%`Custom percentage formatter
customTooltip(item: FunnelData, percentage: number) => stringundefinedCustom tooltip content
animationDurationnumber300Animation duration in milliseconds
colorsobject{ labelText: '#374151', labelBackground: 'white', stroke: 'white' }Custom colors
classNamestring''Additional CSS classes
styleobject{}Additional inline styles

Data Structure

interface FunnelData {
  label: string;      // Label for the funnel level
  value: number;      // Numeric value
  color: string;      // Color for the funnel level
  subLabel?: string;  // Optional additional information
}

License

MIT © Mr.Jack

1.0.22

6 months ago

1.0.21

6 months ago

1.0.20

6 months ago

1.0.19

6 months ago

1.0.18

6 months ago

1.0.17

6 months ago

1.0.16

6 months ago

1.0.15

6 months ago

1.0.14

6 months ago

1.0.13

6 months ago

1.0.12

6 months ago

1.0.11

6 months ago

1.0.10

6 months ago

1.0.9

6 months ago

1.0.8

6 months ago

1.0.7

6 months ago

1.0.6

6 months ago

1.0.5

6 months ago

1.0.4

6 months ago

1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago