Methods
# static createColor(red, green, blue, opacityopt) → {string}
function to create rgba colors
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
red |
number | number between 0 and 255 that represents the amount of red within the rgba | ||
green |
number | number between 0 and 255 that represents the amount of green within the rgba | ||
blue |
number | number between 0 and 255 that represents the amount of blue within the rgba | ||
opacity |
number |
<optional> |
1 | number between 0 and 1 that represents the amount of opacity within the rgba |
value rgba color
string
Example
createColor({
red: 255,
green: 150,
blue: 25,
opacity: 0.2
})
# static createDatasetColor(backgroundColoropt, borderColoropt, backgroundOpacityopt) → {Object}
function to create colors inside datasets
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
backgroundColor |
string |
<optional> |
null | background color for a dataset |
borderColor |
string |
<optional> |
null | border color for a dataset |
backgroundOpacity |
boolean |
<optional> |
false | background color opacity is true or false |
colors to dataset
Object
# static reusableChartBuild(datasets, datasetFunction, htmlElementContainer, idElement, options) → {Object}
function to build a chart reusable
Parameters:
Name | Type | Description |
---|---|---|
datasets |
array | array of objects containing the dataset groups, its structure depends of chart |
datasetFunction |
function | function for each dataset in datasets |
htmlElementContainer |
HTMLBodyElement | container html element, where the chart is inserted |
idElement |
string | chart id |
options |
Object | object of preferences in chartjs |
chart
Object
# static reusableOnClickFunction($event, chart, clickEventForEachElement) → {null|*}
reusable function that allows to use onclick function in different instances
Parameters:
Name | Type | Description |
---|---|---|
$event |
Object | description of the event onclick |
chart |
Object | constructed chart |
clickEventForEachElement |
function | callback function that receives the basic values:
|
null
|
*