legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle' }
import { ChartModule, HIGHCHARTS_MODULES } from 'angular-highcharts'; import * as highmaps from 'highcharts/modules/map.src';
@NgModule({ imports: [ ChartModule ], providers: [ { provide: HIGHCHARTS_MODULES, useFactory: () => { return [ highmaps ]; } } ] })
this.chart = new Chart({ chart: { type: 'line' }, title: { text: 'Line Chart' }, xAxis: { categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May'] }, yAxis: { title: { text: 'Values' } }, legend: { layout: 'vertical', align: 'right', verticalAlign: 'middle', itemMarginTop: 10, symbolPadding: 10, itemHoverStyle: { color: '#666' }, itemStyle: { color: '#333' }, itemclick: function (event) { alert('Category clicked'); } },
series: [{ name: 'Tokyo', data: [7.0, 6.9, 9.5, 14.5, 18.4] }, { name: 'New York', data: [-0.2, 0.8, 5.7, 11.3, 17.0] }, { name: 'Berlin', data: [-0.9, 0.6, 3.5, 8.4, 13.5] }, { name: 'London',
上一篇:Angular11-subscribeisdeprecated:Useanobserverinsteadofacompletecallback
下一篇:Angular11-TypeError:Failedtoexecute'fetch'on'Window':Illegalinvocation