GaChart
A custom element for creating Chart.js in a LitElement web component.
Features
Supports multiple chart types such as line, bar. Dynamic data and options property to easily update chart information. Option to enable or disable animations. Option to add a HTML based legend for the chart. Tooltip position can be adjusted for better visibility.
Installation
To install the package, run the following command:
npm install ga-chart
Usage
<ga-chart
type="line"
data="{...}"
options="{...}"
withAnimation
withHTMLLegend
tooltipPos="center"
></ga-chart>
Properties
-
type
: (String) Specifies the type of chart to be created. Default value is "line". -
data
: (Object) Data to be used for creating the chart. -
options
: (Object) Options to customize the chart. -
withAnimation
: (Boolean) Enable or disable animations for the chart. Default value is false. -
withHTMLLegend
: (Boolean) Adds a HTML based legend for the chart. Default value is false. -
tooltipPos
: (String) Specifies the position of the tooltip on the chart. Default value is "center".