import 'zone.js'; import 'reflect-metadata'; import { Component, enableProdMode, NgModule } from '@angular/core'; import { BrowserModule } from '@angular/platform-browser'; import { ViserModule } from 'viser-ng'; import * as $ from 'jquery'; const DataSet = require('@antv/data-set'); const { DataView } = DataSet; function getMonthWeek(date) { const year = date.getFullYear(); const month = date.getMonth(); const monthFirst = new Date(year, month, 0); const intervalDays = Math.round((date.getTime() - monthFirst.getTime()) / 86400000); const index = Math.floor((intervalDays + monthFirst.getDay()) / 7); return index; } const scale = [{ dataKey: 'month', type: 'cat', values: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", 'December'] }, { dataKey: 'day', type: 'cat', }, { dataKey: 'week', type: 'cat', values: ['5', '4', '3', '2', '1', '0'], }, { dataKey: '涨跌幅', type: 'linear', min: -10, max: 10, sync: true, }, { dataKey: 'time', type: 'time', }, { dataKey: '日期', type: 'time', }]; @Component({ selector: '#mount', template: `