Я пытаюсь интегрировать C3 Gauge Chart: http://c3js.org/samples/chart_gauge.html в новое приложение Angular 5.
Вот мой код chart.component.ts:
import { Component, OnInit, AfterViewInit } from '@angular/core';
import * as c3 from 'c3';
@Component({
selector: 'app-chart',
templateUrl: './chart.component.html',
styleUrls: ['./chart.component.css']
})
export class ChartComponent implements OnInit, AfterViewInit {
constructor() { }
ngOnInit() {
}
ngAfterViewInit() {
let chart = c3.generate({
bindto: '#chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}
});
}
}
Вот мой chart.component.html
<div id="chart"></div>
Но я получаю следующую ошибку.
То, что здесь, не решило мою проблему: Как добавить диаграммы C3 в проект angular 2+