1.0.19 • Published 5 months ago

chart-ssb v1.0.19

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

This library is create Line chart by ChartJS, react-chartjs-2

Support PointElement,LineElement,BarElement,

Getting started

npm i chart-ssb

or

yarn add chart-ssb

How to use

ReactJS

import { ChartSSB } from "chart-ssb"

NextJS

import dynamic from "next/dynamic";
const ChartSSB = dynamic(() => import('chart-ssb').then((mod) => mod.ChartSSB), {ssr: false});

Example

<div style={{ width: "100%", height: "500px", position: "relative" }}>
    <ChartSSB
      type={"line"}
      title={"Test Title"}
      showTitle={false}
      label={"Test Label"}
      showLabel={false}
      tooltipLabel={"฿"}
      tooltipBackground={"#0c5ae5"}
      xAxisData={newX}
      yAxisData={newY}
      pointSize={4}
      pointColor={"#0C5AE5"}
      borderSize={3}
      lineColor={"#0C5AE5"}
      fill={true}
      fillHeight={500}
      fillStart={"rgba(12, 90, 229, 0.30)"}
      fillStop={"rgba(12, 90, 229, 0.0)"}
      tension={0.4}
      offset={true}
      stepSizeY={20}
      gridXDisplay={false}
      gridYDisplay={false}
      xLabelDisplay={true}
      yLabelDisplay={true}
      scroll={scroll}
      maxScreen={MAX_SCREEN}
      maxHeight={"500px"}
      tickXdisplay={scalesX}
      totalXlength={total_X_LENGTH}
      prevArrowStyle={{}}
      nextArrowStyle={{}}
    />
</div>

Attribute

Attributetypeoptions
typestring"line", "bar", default {"line"}
titlestring
showTitlebooldefault {false}
labelstring
showLabelbooldefault {false}
tooltipLabelstring
tooltipBackgroundstring
xAxisDataarray[]
yAxisDataarray[]
pointSizeint
pointColorstringHEX, RGB, RGBA
borderSizeint
lineColorstringHEX, RGB, RGBA
fillbooldefault {false}
fillHeightint
fillStartstringHEX, RGB, RGBA
fillStopstringHEX, RGB, RGBA
tensionfloat
animationbooldefault {false}
offsetbooldefault {false}
stepSizeYnumber
gridXDisplaybooldefault {false}
gridYDisplaybooldefault {false}
xLabelDisplaybooldefault {true}
yLabelDisplaybooldefault {true}
scrollbooldefault {false}
maxScreennumberscreen width
maxHeightstringheight as same as parent
tickXdisplaynumbernumber of x tick to display
totalXlengthnumbertotal of xAxisData length
prevArrowStylesx propsmui sx props style prev arrow
nextArrowStylesx propsmui sx props style next arrow
1.0.19

5 months ago

1.0.18

5 months ago

1.0.17

5 months ago

1.0.16

8 months ago

1.0.15

8 months ago

1.0.14

8 months ago

1.0.13

8 months ago

1.0.12

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.9

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.3

8 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago