Simply crate and use various charts


Keywords
chart, svg, opensource, d3, data, visualization, JavaScript
License
MIT
Install
npm install ssart@1.0.13

Documentation

https://www.ssart.org/

npm dependencies install size


Open Source Project SSART

SSART is the best library to apply chart in your Product !
You can freely use ssart in various frameworks such as Vue and React.
Using the vector image-based svg as a basic, it has clearer resolution and can be easily modified.
It also provides reactive charts, svg image storage, and data color change functions.
Use SSart and apply various charts in your project ๐Ÿ“Š

ํ•œ๊ตญ์–ด
ssart๋Š” ๋‹ค์–‘ํ•œ ์ฐจํŠธ๋ฅผ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•  ์ˆ˜ ์žˆ๋Š” ์ตœ๊ณ ์˜ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์ž…๋‹ˆ๋‹ค
Vue ์™€ React ๊ฐ™์€ ๋‹ค์–‘ํ•œ ํ”„๋ ˆ์ž„ ์›Œํฌ์—์„œ ์ž์œ ๋กญ๊ฒŒ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
vector ์ด๋ฏธ์ง€ ๊ธฐ๋ฐ˜์˜ svg๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„ ๋ช…ํ•œ ํ•ด์ƒ๋„๋ฅผ ๊ฐ€์ง„ ์ฐจํŠธ๋ฅผ ์ž์œ ๋กญ๊ฒŒ ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
๋˜ํ•œ, ๋ฐ˜์‘ํ˜• ์ฐจํŠธ, svg ์ด๋ฏธ์ง€ ์ €์žฅ ๊ธฐ๋Šฅ, ๋ฐ์ดํ„ฐ ์ƒ‰์ƒ ๋ณ€๊ฒฝ ๊ธฐ๋Šฅ ๋“ฑ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค.
ssart๋ฅผ ์ด์šฉํ•˜์—ฌ ๋‹ค์–‘ํ•œ ์ฐจํŠธ๋ฅผ ์—ฌ๋Ÿฌ๋ถ„์˜ ํ”„๋กœ์ ํŠธ์— ์ ์šฉํ•ด ๋ณด์„ธ์š”

Installing


If you use npm, npm install SSart You can also download the latest release on GitHub

$ npm install ssart 

or

$ npm i ssart 

If you want to import the whole chart bundle, just add this in your code:

import "ssart" ; 

Environment

All contents of the library were created using JavaScript.


Examples

AreaChart

This chart which is based on the line chart displays graphically quantitative data.

The area between axis and line are commonly emphasized with colors, textures and hatchings.

Commonly one compares two or more quantities with an area chart.

์˜์—ญ ์ฐจํŠธ (Araa chart) ๋Š” ๋„ํ˜•์˜ ๋„“์ด๋ฅผ ์ด์šฉํ•˜์—ฌ ๋ฐ์ดํ„ฐ์˜ ์ •๋Ÿ‰์  ํฌ๊ธฐ๋ฅผ ๋‚˜ํƒ€๋ƒ…๋‹ˆ๋‹ค.

๋ฉด์  ๊ทธ๋ž˜ํ”„๋Š” ๋‘๊ฐœ ์ด์ƒ์˜ ์ž๋ฃŒ๋ฅผ ๋น„๊ตํ•˜๋Š”๋ฐ ์šฉ์ดํ•˜๊ฒŒ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค.



BarChart

This chart that represents categorical data as vertical rectangular bars with height and length proportional to the representation values

๋ง‰๋Œ€ ์ฐจํŠธ(bar chart) ๋Š” ํ‘œํ˜„ ๊ฐ’์— ๋น„๋ก€ํ•˜์—ฌ ๋†’์ด์™€ ๊ธธ์ด๋ฅผ ๊ฐ€์ง„ ์ง์‚ฌ๊ฐํ˜• ๋ง‰๋Œ€๋กœ ๋ฒ”์ฃผํ˜• ๋ฐ์ดํ„ฐ๋ฅผ ํ‘œํ˜„ํ•˜๋Š” ์ฐจํŠธ๋ฅผ ๋งํ•ฉ๋‹ˆ๋‹ค.

์ž๋ฃŒ์˜ ๋Œ€์†Œ๊ด€๊ณ„๋ฅผ ํ•œ๋ˆˆ์— ์•Œ์•„๋ณด๊ธฐ ์‰ฝ๊ณ  ์ง๊ด€์ ์ž…๋‹ˆ๋‹ค.


Bubble Chart

This chart displays three dimensions of data.

Each entity is plotted as a disk that express two of the values through the disk's x-axis and y-axis and the thrid thrugh its size.

๊ฑฐํ’ˆํ˜• ์ฐจํŠธ(Bubble Chart)๋Š” 3์ฐจ์› ๋ฐ์ดํ„ฐ๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ์ฐจํŠธ ์œ ํ˜•์ž…๋‹ˆ๋‹ค. ๊ฐ๊ฐ์˜ ์ขŒํ‘œ x,y ๊ฐ’๊ณผ ์ด์˜ ๊ฐ€์ค‘์น˜ ( v , ๊ฑฐํ’ˆ์˜ ํฌ๊ธฐ ) ๋กœ ๊ตฌ์„ฑ๋˜์–ด์žˆ์Šต๋‹ˆ๋‹ค.

๊ฑฐํ’ˆํ˜• ์ฐจํŠธ๋Š” ์‚ฌํšŒ, ๊ฒฝ์ œ, ์˜๋ฃŒ ๋ฐ ๊ธฐํƒ€ ๊ณผํ•™์  ๊ด€๊ณ„์— ๋Œ€ํ•œ ์ดํ•ด๋ฅผ ์šฉ์ดํ•˜๊ฒŒ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.



CircleChart

This chart is a graph showing the ratio of each part to the whole as a percentage in a fan shape.

The central angle of each sector represents the proportion of the total, and has the advantage of being able to see the ratio at a glance.

์›ํ˜• ์ฐจํŠธ(Circle chart)๋Š” ์ „์ฒด์— ๋Œ€ํ•œ ๊ฐ ๋ถ€๋ถ„์˜ ๋น„์œจ์„ ๋ถ€์ฑ„๊ผด ๋ชจ์–‘์œผ๋กœย ๋ฐฑ๋ถ„๋ฅ  ๋กœ ๋‚˜ํƒ€๋‚ธ ๊ทธ๋ž˜ํ”„์ž…๋‹ˆ๋‹ค.

๊ฐ ๋ถ€์ฑ„๊ผด์˜ ์ค‘์‹ฌ๊ฐ์ด ์ „์ฒด์—์„œ ์ฐจ์ง€ํ•˜๋Š” ๋น„์œจ์„ ๋‚˜ํƒ€๋‚ด๋ฉฐ, ๋น„์œจ์„ ํ•œ๋ˆˆ์— ๋ณผ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

์ „์ฒด์ ์ธ ๋น„์œจ์„ ์‰ฝ๊ฒŒ ํŒŒ์•…ํ•  ์ˆ˜ ์žˆ์–ด์„œ ์–ธ๋ก ์‚ฌ์—์„œ ํ†ต๊ณ„ ์ˆ˜์น˜๋ฅผ ๊ณต๊ฐœํ•  ๋•Œ ์ž์ฃผ ํ™œ์šฉ๋ฉ๋‹ˆ๋‹ค.



LineChart

This chart that uses lines to show how different pieces of information are related to each other.

๊ฐ ๋ฐ์ดํ„ฐ๋ฅผ ์ ์œผ๋กœ ํ‘œ์‹œํ•˜๊ณ  ๊ทธ ์ ๋“ค์„ ์„ ๋ถ„์œผ๋กœ ์ด์–ด ๊ทธ๋ฆฐ ์ฐจํŠธ์ž…๋‹ˆ๋‹ค.

๋ฐ์ดํ„ฐ ๊ฐ’์ด ๋ณ€ํ™”ํ•˜๋Š” ๋ชจ์–‘๊ณผ ์ •๋„๋ฅผ ์‰ฝ๊ฒŒ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.



Polar Chart

Polar charts are similar to pie charts, but each dataset has the same angle.

Each data set has a different radius size depending on the value. Useful when displaying comparison data similar to pie charts.

๊ทน์ง€๋ฐฉ ์ฐจํŠธ๋Š” ์› ์ฐจํŠธ์™€ ๋น„์Šทํ•˜์ง€๋งŒ ๊ฐ ๋ฐ์ดํ„ฐ์…‹์ด ๊ฐ™์€ ๊ฐ์„ ๊ฐ€์ง‘๋‹ˆ๋‹ค.

๊ฐ ๋ฐ์ดํ„ฐ์…‹์€ ๊ฐ’์— ๋”ฐ๋ผ ๋ฐ˜์ง€๋ฆ„์˜ ํฌ๊ธฐ๊ฐ€ ๋‹ค๋ฆ…๋‹ˆ๋‹ค.

์›ํ˜•์ฐจํŠธ์™€ ์œ ์‚ฌํ•œ ๋น„๊ต ๋ฐ์ดํ„ฐ๋ฅผ ํ‘œ์‹œํ•  ๋•Œ ์œ ์šฉํ•ฉ๋‹ˆ๋‹ค. ๋‹จ ํ•ด๋‹น ๋ฐ์ดํ„ฐ์…‹์˜ ๊ฐ’ ๋˜ํ•œ ํ‘œ์‹œํ•ฉ๋‹ˆ๋‹ค



RadarChart

This is a diagram that divides various evaluation items into polygons according to the number of items,

draws points according to the score of the items, and connects the points to form a line so that the balance between items can be seen at a glance.

๋ ˆ์ด๋‹ค ์ฐจํŠธ(Radar Chart)๋Š” ์–ด๋–ค ์ธก์ • ๋ชฉํ‘œ์— ๋Œ€ํ•œ ํ‰๊ฐ€ํ•ญ๋ชฉ์ด ์—ฌ๋Ÿฌ ๊ฐœ์ผ ๋•Œ ํ•ญ๋ชฉ ์ˆ˜์— ๋”ฐ๋ผ ์›์„ ๊ฐ™์€ ๊ฐ„๊ฒฉ์œผ๋กœ ๋‚˜๋ˆ„๊ณ ,

์ค‘์‹ฌ์œผ๋กœ๋ถ€ํ„ฐ ์ผ์ • ๊ฐ„๊ฒฉ์œผ๋กœ ๋™์‹ฌ์œผ๋กœ ์ฒ™๋„๋ฅผ ์žฌ๋Š” ์นธ์„ ๋‚˜๋ˆ„์–ด ๊ฐ ํ‰๊ฐ€ํ•ญ๋ชฉ์˜ ์ •๋Ÿ‰ํ™”๋œ ์ ์ˆ˜์— ๋”ฐ๋ผ

๊ทธ ์œ„์น˜์— ์ ์„ ์ฐ๊ณ  ํ‰๊ฐ€ํ•ญ๋ชฉ๊ฐ„ ์ ์„ ์ด์–ด ์„ ์œผ๋กœ ๋งŒ๋“ค์–ด ํ•ญ๋ชฉ ๊ฐ„ ๊ท ํ˜•์„ ํ•œ๋ˆˆ์— ๋ณผ ์ˆ˜ ์žˆ๋„๋ก ํ•ด์ฃผ๋Š” ์ฐจํŠธ์ž…๋‹ˆ๋‹ค.

์—ฌ๋Ÿฌ ์ธก์ • ๋ชฉํ‘œ๋ฅผ ํ•จ๊ป˜ ๊ฒน์ณ ๋†“์•„ ๋น„๊ตํ•˜๊ธฐ์—๋„ ํŽธ๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ๊ฐ ํ•ญ๋ชฉ ๊ฐ„ ๋น„์œจ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๊ท ํ˜•๊ณผ ๊ฒฝํ–ฅ์„ ์ง๊ด€์ ์œผ๋กœ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.



ScatterChart

This chart is a type of plot or mathematical diagram using coordinates to display values for typically two variables for a set of data.

The data are displayed as a collection of points on the horizontal axis and the vertical axis.

์‚ฐ์ ๋„ ์ฐจํŠธ(Scatter chart)๋Š” ์ง๊ต ์ขŒํ‘œ๊ณ„ (๋„ํ‘œ) ๋ฅผ ์ด์šฉํ•ด ์ขŒํ‘œ์ƒ์˜ ์ ์„ ํ‘œ์‹œํ•จ์œผ๋กœ์จ ๋‘ ๊ฐœ ๋ณ€์ˆ˜๊ฐ„์˜ ๊ด€๊ณ„๋ฅผ ๋‚˜ํƒ€๋‚ด๋Š” ๋ฐฉ๋ฒ•์ž…๋‹ˆ๋‹ค.

๋‘ ๋ณ€์ˆ˜ ์‚ฌ์ด์˜ ๊ด€๊ณ„๋ฅผ ์•Œ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.



if you want to see more Examples , plz visit our sites and see more chart SSART.


How to Use

Area
  const data = {
    labels: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    datasets: [
        {
            label: '๋ผ์ธ ๋ฐ์ดํ„ฐ1',
            data: [
                { name: 1, value: 10 },
                { name: 2, value: 29 },
                { name: 3, value: 32 },
                { name: 4, value: 25 },
                { name: 5, value: 23 },
                { name: 10, value: 15 }
            ],
            backgroundColor: "red",
        },
        {
            label: '๋ผ์ธ ๋ฐ์ดํ„ฐ2',
            data: [1, 3, 3, 4, 5, 6, 7, 8, 9, 10]
            ,
            backgroundColor: "blue",
        },
        {
            label: '๋ผ์ธ ๋ฐ์ดํ„ฐ3',
            data: [
                { x: 1, y: 15 },
                { x: 2, y: 23 },
                { x: 3, y: 25 },
                { x: 4, y: 32 },
                { x: 5, y: NaN },
                { x: 6, y: 8 },
                { x: 7, y: 13 },
                { x: 8, y: 15 },
            ],
        }
    ]
  };
  const config = {
    type: 'area',
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    options: {
        responsive: true,
        plugins: {
            legend: {
                position: 'bottom',// top bottom left right
            },
            title: {
                display:  true,
                text: 'Area Chart'
            },
            xTitle: {
                display:  true,
                text: 'y'
            },
            yTitle: {
                display:  true,
                text: 'x'
            },

            xGrid : {
                display:  true,
                color: "#323233",// "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",// ์ ์„ , 10๋งŒํผ ์น ํ•˜๊ณ  3๋งŒํผ ๋นˆ๊ณต๊ฐ„
                weight: 1,  // ์„  ๋‘๊ป˜
                opacity: .5 // ์„  ํˆฌ๋ช…๋„ 
            },

            yGrid: {
                display:  true,
                color: "#323233", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",// ์ ์„ , 10๋งŒํผ ์น ํ•˜๊ณ  3๋งŒํผ ๋นˆ๊ณต๊ฐ„
                weight: 1, // ์„  ๋‘๊ป˜
                opacity: .5 // ์„  ํˆฌ๋ช…๋„
            },

            menu: {
                // grid: true,
                xGrid:  true,
                yGrid:  true,
                download:  true,

            }
        },
        scales: {
            xAxis : {
                type : "number",
                ticks:{

                }
            },    
            yAxis : {
                ticks:{

                }
            },
            line :{
                width : 5,
                opacity : .5
            },
            dot :{
                size : 0,
                opacity : 1,
                visible :  true,
            }
        }
    },
  };

Bar (Vertical)
  const data = {
    labels: ['a', 'b', 'c', 'd', 'e', 'f'],
    datasets: [
        {
            label: '๋ฐ์ดํ„ฐ 1',
            data: [
                { name: 'a', value: -10 },
                { name: 'b', value: -29 },
                { name: 'c', value: -32 },
                { name: 'd', value: 25 },
                { name: 'e', value: 23 },
                { name: 'f', value: 15 }
            ],
            // backgroundColor: "red",
        },
        {
            label: '๋ฐ์ดํ„ฐ 2',
            data: [1, 2, 3, 4, 5, 6, -7, -8, -9, -10]
            ,
            // backgroundColor: "blue",
        },
        {
            label: '๋ฐ์ดํ„ฐ 3',
            data:
                [
                    { name: 'a', value: 15 },
                    { name: 'b', value: 23 },
                    { name: 'c', value: 25 },
                    { name: 'd', value: -32 },
                    { name: 'e', value: -29 },
                    { name: 'f', value: -12 },
                    { name: 'g', value: -15 },
                    { name: 'ใ…Ž', value: 1 },
                    { name: 't', value: 12 }
                ],
        },
    ]
  };
  const config = {
    type: 'bar',
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    options: {
        responsive: true,
        plugins: {
            legend: {
                position: 'right',// top bottom left right
                fontSize: '10px',
                fontWeight: 'normal',
                fontFamily: 'comic sans ms',
                legendType: 'rect', // rect(default), circle,
            },
            title: {
                display: true,
                text: 'Bar Chart'
            },
            xTitle: {
                display: true,
                text: 'name'
            },
            yTitle: {
                display: true,
                text: 'value'
            },
            xGrid: {
                // color: "rgb(255, 0, 0)", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                // dash: "10,3",
                // weight: 5,
                // opacity: .5,
            },
            yGrid: {
                // color: "#323233", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                // dash: "10,3",     // ์ ์„ , 10๋งŒํผ ์น ํ•˜๊ณ  3๋งŒํผ ๋นˆ๊ณต๊ฐ„
                // weight: 1,        // ์„  ๋‘๊ป˜
                // opacity: .5,      // ์„  ํˆฌ๋ช…๋„
            },
            // background: {
            // },
            menu: {
                grid: true,
                xGrid: true,
                yGrid: true,
                background: true,
                download: true,
                legend: true
            },
            axis: {
                color: "rgb(255, 0, 0)", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)",
                weight: 5,
                opacity: .5,
                dots: {
                    display: false,
                    color: "rgb(255, 0, 255)", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)",
                    weight: 5,
                    opacity: .5
                },
                xAxis: {
                    color: "rgb(0, 255, 0)", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)",
                    weight: 5,
                    opacity: 1,
                    dots: {
                        display: false,
                        color: "rgb(255, 0, 0)", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)",
                        weight: 5,
                        opacity: 1
                    }
                },
                yAxis: {
                    color: "rgb(255, 0, 255)", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)",
                    weight: 1,
                    opacity: .5,
                    dots: {
                        display: false,
                        color: "rgb(0, 0, 255)", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)",
                        weight: 5,
                        opacity: .5
                    }
                }
            },
        },
        scales: {
            yAxis: {
                ticks: {
                    // min: -20,
                    max: 40
                }
            },
            fillopacity: 0.5
        }
    },
  };


Bar (Horizontal)
  const data = {
    labels: ['a', 'b', 'c', 'd', 'e'],
    datasets: [
      {
        label: '1๋ฒˆ ๋ง‰๋Œ€ label',
        data: [
          { name: 'a', value: 100 },
          { name: 'b', value: 290 },
          { name: 'c', value: 750 },
          { name: 'd', value: 250 },
          { name: 'e', value: 750 },
        ],
        backgroundColor: "red",                    
      },
      {
        label: '2๋ฒˆ ๋ง‰๋Œ€ label',
        data: [100, 200, 320, 45],
        backgroundColor: "blue",
      },
      {
        label: '3๋ฒˆ ๋ง‰๋Œ€ label',
        data: [90, 170, 300, 415],
        backgroundColor: "yellow",
      },
    ]
  };
  const config = {
    type: 'barH',
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    options: {
        responsive:  true,
        plugins: {
            legend: {
                position: 'bottom',// top bottom left right
            },
            title: {
                display:  true,
                text: '๊ฐ€๋กœ๋ง‰๋Œ€ ๊ทธ๋ž˜ํ”„'
            },
            xTitle: {
                display: true,
                text: 'name'
            },
            yTitle: {
                display: true,
                text: 'value'
            },
            xGrid: {
                color: "rgb(255, 0, 0)", //"rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",
                weight: 1,
                opacity: .5,
            },
            yGrid: {
                color: "#323233", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",     // ์ ์„ , 10๋งŒํผ ์น ํ•˜๊ณ  3๋งŒํผ ๋นˆ๊ณต๊ฐ„
                weight: 1,        // ์„  ๋‘๊ป˜
                opacity: .5,      // ์„  ํˆฌ๋ช…๋„
            },
        },
        scales:{
            yAxis : {
            ticks:{
                // min : -10,
                max : 900
                }
            },
        }                    
    }
  };


Bubble chart
  const data = {
    labels: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    datasets: [
        {
            label: 'Small Radius',
            data:
                [
                    [1, -10, 1], [20, 20, 2], [3, 20, 3], [4, 20, 4], [5, 20, 5], [6, 20, 6]
                ],
        },
        {
            label: 'Small Radius',
            data: [
                { x: 1, y: 15, r: 10 },
                { x: 2, y: 23, r: 20 },
                { x: 3, y: 25, r: 30 },
                { x: 4, y: 32, r: 30 },
                { x: 5, y: 29, r: 100 },
                { x: 6, y: 13, r: 20 },
                { x: 7, y: 15, r: 50 },
            ],
        },
        {
            label: 'Small Radius',
            data: [
                { x: 10, y: 150, r: 10 },
                { x: 5, y: 230, r: 20 },
                { x: 6, y: 250, r: 30 },
                { x: 7, y: 32, r: 30 },
                { x: 8, y: 29, r: 100 },
                { x: 9, y: 13, r: 20 },
                { x: 10, y: 15, r: 50 },
            ],
        },
        {
            label: 'Small Radius',
            data: [
                { x: 1, y: 15, r: 10 },
                { x: 2, y: 23, r: 20 },
                { x: 3, y: 25, r: 30 },
                { x: 4, y: 32, r: 30 },
                { x: 5, y: 29, r: 100 },
                { x: 6, y: 13, r: 20 },
                { x: 7, y: 15, r: 50 },
            ],
        }
    ]
  };
  const config = {
    type: 'bubble',
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    options: {
        responsive: true,
        plugins: {
            legend: {
                position: 'bottom',// top bottom left right
            },
            title: {
                display: true,
                text: 'bubble Chart',
                color: '#000000',
                align: 'center' //start, end, center
            },
            xTitle: {
                display: true,
                text: 'x์ถ•',
                size: "15px",
                // color: 'rgba(100, 150, 0, .5)',
                align: 'center' //start, end, center
            },
            yTitle: {
                display: true,
                text: 'y์ถ•',
                size: "15px",
                rotate: true,
                position: 'left',
                color: '#000000',
                align: 'center' //top, bottom, center
            },
            xGrid: {
                color: "rgb(255, 0, 0)", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",
                weight: 1,
                opacity: .5,
            },
            yGrid: {
                color: "#323233", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",     // ์ ์„ , 10๋งŒํผ ์น ํ•˜๊ณ  3๋งŒํผ ๋นˆ๊ณต๊ฐ„
                weight: 1,        // ์„  ๋‘๊ป˜
                opacity: .5,      // ์„  ํˆฌ๋ช…๋„
            },
            menu: {
            }
        },
        scales: {
            xAxis: {
                // type: "number",
                ticks: {
                    min: 0,
                    max: 10
                }
            },
            yAxis: {
                ticks: {
                    max: 80,
                    tick: 20
                }
            },
            r: {
                size: {
                    min: 10,
                    max: 30
                }
            },
            fillopacity: 0.5
        }
    },
  };


Circle chart(Donut / Pie)
  const data = {
    labels: ['dd', 'B', 'C', 'D', 'E', 'F', 'G', 'H'],
    datasets: [{    
            data : [
            { name: 'AAAA', value: 1000, color: '#efa86b' },
            { name: 'BBB', value: 1500, color: '#c1484f' },
            { name: 'C', value: 1300 },
            { name: 'D', value: 900, color: '#f4c17c' },
            { name: 'E', value: 700, color: '#fae8a4' },
            { name: 'F', value: 1200, color: '#df7454' },
            { name: 'G', value: 1100, color: '#e88d5d' },
            { name: 'H', value: 600, color: '#f8d690' },
            ]
        }
    ]
  };
  const config = {
    type: 'donut',// if you want pie chart , change the type to pie!
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    options: {
        responsive:  true,
        plugins: {
            legend: {
                position: 'left',// top bottom left right
            },
            title: {
                display:  true,
                text: 'Donut Chart'
            },
            sort: true,
            view:  true,
        },
    }
  }


Line chart
  const data = {
    labels: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    datasets: [
        {
            label: '๋ผ์ธ ๋ฐ์ดํ„ฐ1',
            data: [
                { name: 1, value: 10 },
                { name: 2, value: 29 },
                { name: 3, value: 32 },
                { name: 4, value: 25 },
                { name: 5, value: 23 },
                { name: 10, value: 15 }
            ],
            backgroundColor: "red",

        },
        {
            label: '๋ผ์ธ ๋ฐ์ดํ„ฐ2',
            data: [1, 3, 3, 4, 5, 6, 7, 8, 9, 10],
            backgroundColor: "blue",
        },
        {
            label: '๋ผ์ธ ๋ฐ์ดํ„ฐ3',
            data: [
                { x: 1, y: 15 },
                { x: 2, y: 23 },
                { x: 3, y: 25 },
                { x: 4, y: 32 },
                { x: 5, y: NaN },
                { x: 6, y: 8 },
                { x: 7, y: 13 },
                { x: 8, y: 15 },
            ],
        }
    ]
  };
  const config = {
    type: 'line',
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    options: {
        responsive:  true,
        plugins: {
            legend: {
                position: 'bottom',// top bottom left right
            },
            title: {
                display:  true,
                text: 'Line Chart'
            },
            xTitle: {
                display:  true,
                text: 'y'
            },
            yTitle: {
                display:  true,
                text: 'x'
            },
            xGrid : {
                display:  true,
                color: "#323233",// "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3", // ์ ์„ , 10๋งŒํผ ์น ํ•˜๊ณ  3๋งŒํผ ๋นˆ๊ณต๊ฐ„
                weight: 1, // ์„  ๋‘๊ป˜
                opacity: .5 // ์„  ํˆฌ๋ช…๋„ 
            },
            yGrid: {
                display:  true,
                color: "#323233",// "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",// ์ ์„ , 10๋งŒํผ ์น ํ•˜๊ณ  3๋งŒํผ ๋นˆ๊ณต๊ฐ„
                weight: 1, // ์„  ๋‘๊ป˜
                opacity: .5 // ์„  ํˆฌ๋ช…๋„
            },
            menu: {
                // grid: true,
                xGrid:  true,
                yGrid:  true,
                download:  true,
            }
        },
        scales: {
            xAxis: {
                type: "number",
                ticks: {
                }
            },
            yAxis: {
                ticks: {
                    max: 20
                }
            },
            line: {
                width: 5,
                opacity: 0.6
            },
            dot: {
                size: 0,
                opacity: 1,
                visible:  true,
            }
        }
    },
};


Polar chart
  const data = {
        labels: ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H'],
        datasets: [{    
            data : [
            { name: 'John', value: 1000, backgroundColor: '#efa86b' },
            { name: 'Abraham', value: 1500, backgroundColor: '#c1484f' },
            { name: 'Jack', value: 1300 },
            { name: 'Madison', value: 900, backgroundColor: '#f4c17c' },
            { name: 'Olivia', value: 700, backgroundColor: '#fae8a4' },
            { name: 'Quincy', value: 1200, backgroundColor: '#df7454' },
            { name: 'Talan', value: 1100, backgroundColor: '#e88d5d' },
            { name: 'Wendy', value: 600, backgroundColor: '#f8d690' },            
            ]
        }        
    ]
  };
  const config = {
    type: 'polar',
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    depth:7, // ๊ตฌ๊ฐ„ ๊ฐฏ์ˆ˜
    options: {
        responsive: true,
        plugins: {
            legend: {
                position: 'top',// top bottom left right
            },
            title: {
                display: true,
                text: 'polar Chart'
            },
            sort: true,
            view: true,
            menu: {
                download: true
            }
        },
        scales:{
            depth : 7
        }
    }
  };


Radar chart
  const data = {
    labels: ['ability1', 'ability2', 'ability3', 'ability4' ,'ability5'],
    datasets: [
        { 
            label: 'A',
            data : [270,270,120,1,140]
        },
        { 
            label: 'B', 
            data :[140,100,280,250,120],
        },
        { 
            label: 'C',
            data : [100,190,140,12,270],
        },
        { 
            label : 'D',
            data : [20,200,200,52,230],
        }
    ],        
  };
  const config = {
    type: 'radar',
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    depth:7, // ๊ตฌ๊ฐ„ ๊ฐฏ์ˆ˜
    poly:true,
    options: {
        responsive: true,
        plugins: {
            legend: {
                position: 'top',// top bottom left right
            },
            title: {
                display: true,
                text: 'Radar Chart'
            },
            sort: true,
            view: true,
            menu: {
                download: true
            }
        },
        scales:{
            depth : 7
        }
    }
  }


Scatter chart
  const data = {
    labels: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9],
    datasets: [
        {
            label: 'Fully Rounded',
            data: [
                { name: 1, value: 10 },
                { name: 2, value: 29 },
                { name: 3, value: 32 },
                { name: 4, value: 25 },
                { name: 5, value: 23 },
                { name: 10, value: 15 }
            ],
            backgroundColor: "red",
        },
        {
            label: 'Small Radius',
            data: [1, 3, 3, 4, 5, 6, 7, 8, 9, 10]
            ,
            backgroundColor: "blue",
        },
        {
            label: 'Small Radius',
            data:
                [
                    [1.5, 1], [2, 2], [3, 2], [4, 2], [5, 2], [6, 2]
                ],
        },
        {
            label: 'Small Radius',
            data: [
                { x: 1, y: 15 },
                { x: 2, y: 23 },
                { x: 3, y: 25 },
                { x: 4, y: 32 },
                { x: 5, y: 29 },
                { x: -6, y: 13 },
                { x: 7, y: 15 },
            ],
        }
    ]
  };
  const config2 = {
    type: 'scatter',
    width: 500,
    height: 500,
    margin: { top: 40, left: 40, bottom: 40, right: 40 },
    padding: 0.1,
    data: data,
    options: {
        responsive: true,
        plugins: {
            // legend: {
            //     // position: 'right',// top bottom left right
            // },
            title: {
                display: true,
                text: 'Scatter Chart'
            },
            xTitle: {
                display: true,
                text: 'y'
            },
            yTitle: {
                display: true,
                text: 'x'
            },
            xGrid: {
                color: "#323233", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",
                weight: 2,
                opacity: .5
            },
            yGrid: {
                display: true,
                color: "#323233", // "rgb(255, 0, 0)" "rgba(255, 0, 0, 0.3)"
                dash: "10,3",     // ์ ์„ , 10๋งŒํผ ์น ํ•˜๊ณ  3๋งŒํผ ๋นˆ๊ณต๊ฐ„
                weight: 2,        // ์„  ๋‘๊ป˜
                opacity: .5       // ์„  ํˆฌ๋ช…๋„
            },
            background: {
            },
            menu: {
                grid: true,
                xGrid: true,
                yGrid: true,
                background: true,
                download: true
            },
        },
        
        scales: {
            xAxis: {
                type: "number",
                ticks: {
                    min: -10,
                    max: 10
                }
            },
            dot: {
                size: 10,
                opacity: 1
            }
        }
    },
  };

Common Code

  <script type="module">// ํ•ด๋‹น ๋ชจ๋“ˆ์„ ๋ถˆ๋Ÿฌ์˜ค๋Š” ๋ช…๋ น์–ด 
        import * as Chart from './src/index.js';
        Chart.Chart('#chart', config);      
    </script>
  <div id="chart"><div>

Browser Support

Chrome Edge Opera
Latest โœ” Latest โœ” Latest โœ”

Developers

ssart microsites

๊ฐœ์ธ ๊นƒํ—™ ๋งํฌ ํ˜น์€ ๋งˆ์ดํฌ๋กœ ์‚ฌ์ดํŠธ์—์„œ ์ •๋ฆฌ


License


Ssart is available under the MIT license.