Index

mmo-chart

1 symbol · generated 30 Sep 2026

element

mmo-chart

mmo-chart.jhs:1

Chart element to display a chart

<mmo-chart url type title schema icon="chart-pie"></mmo-chart>
Extends
CustomShadowElement
The config is based on Chart.js [https://www.chartjs.org/] 1. config explanation : - type : string => type of chart - data : object => data of chart - options : object => options of chart data is an object with the following properties : - labels : array => labels of chart (optional, is mandatory for multiple bars, multiple lines, pie, doughnut, polarArea) - datasets : array => datasets of chart - label : string => label of dataset - data : array => data of dataset - backgroundColor : string|array => background color of dataset - borderColor : string|array => border color of dataset - borderWidth : number => border width of dataset - pointRadius : number => point radius of dataset options is an object with the following properties : - responsive : if true, the chart will be responsive - maintainAspectRatio : if true, the chart will maintain its aspect ratio - aspectRatio : aspect ratio of the chart - scales : scales of the chart - y : object => y axis of the chart - ticks : object => ticks of the y axis - precision : number => precision of the y axis - plugins : plugins of the chart - title : title of the chart - legend : legend of the chart - position : position of the legend - display : if true, the legend will be displayed 2. config example : { "type": "bar", "data": { "datasets": [ { "label": "Paris", "data": [1200, 1300, 1100, 1400], "backgroundColor": ["#004996"], "borderColor": ["#004996"], "borderWidth": 2, "pointRadius": 2 }, { "label": "Londres", "data": [1300, 1500, 900, 1200], "backgroundColor": ["#ffa700"], "borderColor": ["#ffa700"], "borderWidth": 2, "pointRadius": 2 } ] }, "options": { "responsive": true, "maintainAspectRatio": true, "y": { "ticks": { "precision": 0, } }, "plugins": { "title": {"display": false}, "legend": {"position": "top", "display": true} } } - options are optional, if not set, default options are set and will be used

Index

urlthe url to get data from
typethe type of chart to use (default bar)
titlethe title of the chart
schemathe schema to use
iconthe icon to display in chart title
ViewDefault static readonly accessor
type accessorGet the type of the chart
config accessorGet the config of the chart
url accessorGet the url of the chart
collection accessorGet the collection of the chart
collections accessorGet the collections of the chart
schema accessorGet the schema of the chart
data readonly accessorGet the data of the chart
index accessorGet the index of the chart
diff accessorGet the diff of the chart
unit accessorGet the unit of the chart
icon accessorGet the icon of the chart
title accessorGet the title of the chart
constructor()
init()
updateTendency()Update the tendency of the chart
updateChart()Update the chart
update()Update the component
updateTheme(theme)Update the theme of the chart
downloadJSON()Download the data of the chart as a JSON file
configure()Show a configuration in the app panel
onCollectionChange()Update the schema when the collection changes
updateSchema()Update the schema of the chart
(default)a caption shown under the plot, in place of the generated one
.loadinghide toolbar while loading component

Attributes5

icon

mmo-chart.jhs

the icon to display in chart title

icon="chart-pie"

Properties13

type

accessormmo-chart.jhs:156

Get the type of the chart

get type() set type(value)
Type
string

config

accessormmo-chart.jhs:172

Get the config of the chart

get config() set config(value)
Type
object

url

accessormmo-chart.jhs:192

Get the url of the chart

get url() set url(value)
Type
string

collection

accessormmo-chart.jhs:227

Get the collection of the chart

get collection() set collection(value)
Type
string

collections

accessormmo-chart.jhs:246

Get the collections of the chart

get collections() set collections(value)
Type
object

schema

accessormmo-chart.jhs:262

Get the schema of the chart

get schema() set schema(value)
Type
object

index

accessormmo-chart.jhs:298

Get the index of the chart

get index() set index(value)
Type
number

diff

accessormmo-chart.jhs:316

Get the diff of the chart

get diff() set diff(value)
Type
string

unit

accessormmo-chart.jhs:333

Get the unit of the chart

get unit() set unit(value)
Type
string

icon

accessormmo-chart.jhs:350

Get the icon of the chart

get icon() set icon(value)
Type
string

title

accessormmo-chart.jhs:366

Get the title of the chart

get title() set title(value)
Type
string

Methods10

updateTheme(theme)

mmo-chart.jhs:477

Update the theme of the chart

updateTheme(theme)
themestring- The theme of the chart

downloadJSON()

mmo-chart.jhs:491

Download the data of the chart as a JSON file

downloadJSON()

onCollectionChange()

mmo-chart.jhs:595

Update the schema when the collection changes

onCollectionChange()

Slots1

(default)

mmo-chart.jhs

a caption shown under the plot, in place of the generated one

<slot>

CSS hooks1

.loading

mmo-chart.jhs

hide toolbar while loading component

.loading