Ошибка Не удается прочитать свойство 'getBoundingClientRect' с нулевым значением в диаграммах d3-gantt - PullRequest
0 голосов
/ 28 мая 2019

Привет всем, когда я пытаюсь создать график времени

import * as d3timelines from 'd3-timelines';
import * as d3 from 'd3';
export class DashboardThreadedComponent implements OnInit {
 private data: any = [
        {label: 'person a', times: [
            {starting_time: 1355752800000, ending_time: 1355759900000},
            {starting_time: 1355767900000, ending_time: 1355774400000}]},
        {label: 'person b', times: [
            {starting_time: 1355759910000, ending_time: 1355761900000}]},
        {label: 'person c', times: [
            {starting_time: 1355761910000, ending_time: 1355763910000}]},
        ];

private chart: any;
 constructor(
        private cookieService: CookieService,
        private modalService: NgbModal,
        private bpeService: BPEService,
        private userService: UserService,
        private router: Router,
        private route: ActivatedRoute,
        public appComponent: AppComponent
  ) {}

    ngOnInit() {

        this.chart = d3timelines.timelines();

        d3.select('.timeline').append('svg').attr('width', 500)
        .datum(this.data).call(this.chart);

    }
}
}

Но я получаю ошибку ниже

ERROR TypeError: Cannot read property 'getBoundingClientRect' of null

Любой здесь, кто может помочь исправить это. Большое спасибо

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...