Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

chartist

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

chartist

Simple, responsive charts

  • 1.3.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created

What is chartist?

Chartist is a simple, responsive, and customizable charting library for creating various types of charts in web applications. It is designed to be lightweight and easy to use, making it a popular choice for developers who need to quickly add charts to their projects.

What are chartist's main functionalities?

Line Chart

This feature allows you to create a line chart. The code sample demonstrates how to create a simple line chart with labels for the days of the week and three series of data.

const Chartist = require('chartist');
new Chartist.Line('.ct-chart', {
  labels: ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday'],
  series: [
    [12, 9, 7, 8, 5],
    [2, 1, 3.5, 7, 3],
    [1, 3, 4, 5, 6]
  ]
});

Bar Chart

This feature allows you to create a bar chart. The code sample demonstrates how to create a stacked bar chart with labels for the quarters of the year and three series of data.

const Chartist = require('chartist');
new Chartist.Bar('.ct-chart', {
  labels: ['Q1', 'Q2', 'Q3', 'Q4'],
  series: [
    [800000, 1200000, 1400000, 1300000],
    [200000, 400000, 500000, 300000],
    [100000, 200000, 400000, 600000]
  ]
}, {
  stackBars: true,
  axisY: {
    labelInterpolationFnc: function(value) {
      return (value / 1000) + 'k';
    }
  }
});

Pie Chart

This feature allows you to create a pie chart. The code sample demonstrates how to create a donut chart with four segments and custom options for the donut width, start angle, and total value.

const Chartist = require('chartist');
new Chartist.Pie('.ct-chart', {
  series: [20, 10, 30, 40],
  labels: ['A', 'B', 'C', 'D']
}, {
  donut: true,
  donutWidth: 60,
  startAngle: 270,
  total: 200,
  showLabel: true
});

Other packages similar to chartist

Keywords

FAQs

Package last updated on 03 Nov 2022

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc