npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@toast-ui/chart

v4.6.1

Published

TOAST UI Application: Chart

Downloads

11,379

Readme

Toast UI Chart

🍞📈 Spread your data on TOAST UI Chart. TOAST UI Chart is Beautiful Statistical Data Visualization library

npm

🚩 Table of Contents

Collect statistics on the use of open source

TOAST UI Chart applies Google Analytics (GA) to collect statistics on the use of open source, in order to identify how widely TOAST UI Chart is used throughout the world. It also serves as important index to determine the future course of projects. location.hostname (e.g. > “ui.toast.com") is to be collected and the sole purpose is nothing but to measure statistics on the usage. To disable GA, use the following usageStatistics option when creating charts.

const options = {
  // ...
  usageStatistics: false,
};

toastui.Chart.barChart({ el, data, options });

💾 Install

The TOAST UI products can be installed by using the package manager or downloading the source directly. However, we highly recommend using the package manager.

Via Package Manager

The TOAST UI products are registered in npm package manager. Install by using the commands provided by a package manager. When using npm, be sure Node.js is installed in the environment.

npm

$ npm install --save @toast-ui/chart # Latest version
$ npm install --save @toast-ui/chart@<version> # Specific version

Via Contents Delivery Network (CDN)

The TOAST UI Chart is available over a CDN.

  • You can use cdn as below.
<link rel="stylesheet" href="https://uicdn.toast.com/chart/latest/toastui-chart.min.css" />
<script src="https://uicdn.toast.com/chart/latest/toastui-chart.min.js"></script>
  • Within the download you'll find the following directories
- uicdn.toast.com/
  ├─ chart/
  │  ├─ latest
  │  │  ├─ toastui-chart.js
  │  │  ├─ toastui-chart.min.js
  │  │  ├─ toastui-chart.css
  │  │  ├─ toastui-chart.min.css
  │  ├─ v4.0.0/

Download Source Files

🔨 Usage

HTML

Add the container element where TOAST UI Chart will be created.

<div id="chart"></div>

JavaScript

Load

The TOAST UI Chart can be used by creating an instance with the constructor function. To access the constructor function, import the module using one of the three following methods depending on your environment.

/* namespace */
const chart = toastui.Chart;

/* CommonJS in Node.js */
const chart = require('@toast-ui/chart');

/* ES6 in Node.js */
import Chart from '@toast-ui/chart';
import { LineChart } from '@toast-ui/chart';

In Webpack 4, when importing package modules, the parts that are defined in the module field have higher priority than the parts defined in the main field. To use the Webpack 4 with the require syntax to import @toast-ui/chart, the ESM file defined in the module field will be loaded, and the file will be transpiled to be compatible with the require syntax. In order to use the bundle file for UMD, the user must personally load and use the @toast-ui/chart/dist/toastui-chart.js or @toast-ui/chart/dist/toastui-chart.min.js.

const Chart = require('@toast-ui/chart/dist/toastui-chart.min.js'); // loading the bundle file for UMD

Webpack 5 supports the exports field. The entry point can be determined by the exports field defined in the package. Furthermore, the necessary chart can be loaded through a sub-path, as presented below.

const Chart = require('@toast-ui/chart');  // ./dist/toastui-chart.js

import { BarChart } from '@toast-ui/chart';  // ./dist/esm/index.js

import BarChart from '@toast-ui/chart/bar';
import ColumnChart from '@toast-ui/chart/column';
import LineChart from '@toast-ui/chart/line';
import AreaChart from '@toast-ui/chart/area';
import LineAreaChart from '@toast-ui/chart/lineArea';
import ColumnLineChart from '@toast-ui/chart/columnLine';
import BulletChart from '@toast-ui/chart/bullet';
import BoxPlotChart from '@toast-ui/chart/boxPlot';
import TreemapChart from '@toast-ui/chart/treemap';
import HeatmapChart from '@toast-ui/chart/heatmap';
import ScatterChart from '@toast-ui/chart/scatter';
import LineScatterChart from '@toast-ui/chart/lineScatter';
import BubbleChart from '@toast-ui/chart/bubble';
import PieChart from '@toast-ui/chart/pie';
import NestedPieChart from '@toast-ui/chart/nestedPie';
import RadarChart from '@toast-ui/chart/radar';

Constructor function needs three parameters: el, data, options

  • el: Wrapper HTML element that will contain the chart as a child.
  • data: Numerical data the chart will be based on.
  • options: Functional options including legend, alignment, and tooltip formatter.
const el = document.getElementById('chart');
const data = {
  categories: [
    //...
  ],
  series: [
    // ...
  ],
};
const options = {
  chart: { width: 700, height: 400 },
};

chart.barChart({ el, data, options });
// or
new BarChart({ el, data, options });

Refer to details for additional information.