Example with a TS definitions
anasmi opened this issue · 1 comments
anasmi commented
There is no example on how to use Charts in LitElement using TypeScript.
It would be great to have one, since, for example, Chart
definition is coming from Highcharts
and used for configuration of a ChartElement
(which is Vaadin's TS definition).
For example, migrated method from start.vaadin.com
for a dashboard view seems like this (Not sure if it's correct, thus would be great to have an example : ) )
private addSeries(chart: ChartElement, series: ChartSeries[]) {
const conf = chart.configuration as Chart;
series.forEach(data => conf.addSeries(data as SeriesOptionsType));
}
where imports are :
import type { ChartElement} from '@vaadin/vaadin-charts'
import {Chart,SeriesOptionsType} from 'highcharts';
web-padawan commented
Added a basic configuration example at web-padawan/ts-vaadin-examples@432519e
Live demo: https://vaadin-ts-examples.herokuapp.com/chart-configuration