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
Latest |
Latest |
Latest |
Developers
- Lee JungHun : person00333@gmail.com
- Kim YoungJin : kimyj1288@gmail.com
- Bae YongHan : byh5112@naver.com
- Ahn JaeYoung : abogado2113@gmail.com
- Jeong HaeYun : godbs98@naver.com
- Jo wonbin : jwb7214@gmail.com
๊ฐ์ธ ๊นํ ๋งํฌ ํน์ ๋ง์ดํฌ๋ก ์ฌ์ดํธ์์ ์ ๋ฆฌ
License
Ssart is available under the MIT license.