Run
Auto Run
define('my-app', class extends WeElement { install(){ this.configs = []; [ 'circle', 'triangle', 'rect', 'rectRounded', 'rectRot', 'cross', 'crossRot', 'star', 'line', 'dash' ].forEach((pointStyle) => { this.configs.push(createConfig(pointStyle)) }) } render(props, data) { return (
{this.configs.map(config => (
))}
) } }) render(
, 'body') function createConfig(pointStyle) { return { type: 'line', data: { labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'], datasets: [{ label: 'My First dataset', backgroundColor: 'rgb(255, 99, 132)', borderColor: 'rgb(255, 99, 132)', data: [10, 23, 5, 99, 67, 43, 0], fill: false, pointRadius: 10, pointHoverRadius: 15, showLine: false // no line shown }] }, options: { responsive: true, title: { display: true, text: 'Point Style: ' + pointStyle }, legend: { display: false }, elements: { point: { pointStyle: pointStyle } } } } }