0.0.4 • Published 2 years ago
@suspack-item/chartjs v0.0.4
@suspack-item/chartjs
This is a sample project for suspack.
package
2 가지 방식으로 제공
- npm package - @suspack-item/chartjs
- dist 디렉토리 - 복사해서 쓰세요.
- index.mjs
- style.css
config
특정 config 를 사용하고 싶다면, 아래와 같이 설정하세요.
%%CONFIG%%
문자열 그대로 JSON string 으로 치환해줍니다.
content = content.replace('%%CONFIG%%', JSON.stringify(config))
Properties
suspack: SuspackInstance
suspack dependencies manager for remote component
type: string
chart type
- line
- pie
data: object
chart data
- lables: x axis labels
- datasets: y axis data
<ChartJS data={{
labels: ["2", "February", "March", "April", "May", "June", "July"],
datasets: [
{
label: "My First dataset",
data: [65, 59, 80, 81, 56, 55, 40],
fill: false,
borderColor: "rgb(75, 192, 192)",
tension: 0.1,
},
],
}} />
style: object
chart style
<ChartJS style={{
width: 300,
height: 400
}} />
options: object
chart meta options
<ChartJS options={{
scales: {
y: {
beginAtZero: true
}
}
}} />