🚀 Socket Launch Week Day 4:Socket MCP Adds Org Alerts, Threat Feed Review, and Package Inspection.Learn more
Sign In

chartie

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chartie

Ultra-lightweight canvas-based charting library - Chart.js alternative under 10kb

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

Chartie

Ultra-lightweight canvas-based charting library under 10kb.

Installation

npm install chartie

Quick Start

JavaScript

import { Chartie } from 'chartie';

const chart = new Chartie('canvas-id', {
  type: 'bar',
  data: {
    labels: ['Jan', 'Feb', 'Mar', 'Apr'],
    datasets: [{
      label: 'Sales',
      data: [12, 19, 3, 5],
      backgroundColor: '#3b82f6'
    }]
  }
});

React

import { useEffect, useRef } from 'react';
import { Chartie } from 'chartie';

function Chart() {
  const canvasRef = useRef(null);

  useEffect(() => {
    const chart = new Chartie(canvasRef.current, {
      type: 'line',
      data: {
        labels: ['Mon', 'Tue', 'Wed', 'Thu'],
        datasets: [{
          label: 'Revenue',
          data: [65, 59, 80, 81],
          borderColor: '#ef4444',
          fill: true
        }]
      }
    });

    return () => chart.destroy();
  }, []);

  return <canvas ref={canvasRef}></canvas>;
}

Chart Types

TypeDescription
barVertical bar chart
lineLine chart with optional fill
areaFilled line chart
piePie chart
doughnutDoughnut chart
scatterScatter plot

Configuration

const config = {
  type: 'line',
  data: {
    labels: ['Q1', 'Q2', 'Q3', 'Q4'],
    datasets: [{
      label: 'Revenue',
      data: [100, 120, 115, 134],
      borderColor: '#3b82f6',
      backgroundColor: 'rgba(59, 130, 246, 0.1)',
      fill: true
    }]
  },
  options: {
    legend: {
      display: true
    },
    scales: {
      y: {
        display: true,
        grid: { display: true }
      }
    }
  }
};

Features

  • ✅ 6 chart types
  • ✅ Under 10kb gzipped
  • ✅ Zero dependencies
  • ✅ TypeScript support
  • ✅ Responsive & retina ready
  • ✅ Smooth animations

Contributing

Contributions are very welcome! We're still at the very beginning and would love your help to make Chartie even better.

  • 🐛 Report bugs
  • 💡 Suggest new features
  • 🔧 Submit pull requests
  • 📚 Improve documentation

Check out our GitHub repository to get started!

Repository

GitHub Repository

License

MIT

Keywords

charts

FAQs

Package last updated on 23 Jun 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts