프로젝트 중 하나에서 D3 차트를 사용하고 싶습니다.각도 2 또는 4의 D3 차트 사용 방법
설치 과정을 시도했습니다. 하지만 제대로 작동하지 않아 peasen이 다른 솔루션을 제공하므로 기존 프로젝트에서이를 구현할 수 있습니다.
npm install d3-ng2-service --save
import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ApplicationRef } from '@angular/core';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { AppComponent } from './app.component';
import { D3Service } from 'd3-ng2-service'; // <-- import statement
@NgModule({
declarations: [
AppComponent,
TestD3Component // <-- declaration of the D3 Test component used below
],
imports: [
BrowserModule,
CommonModule,
FormsModule
],
providers: [D3Service], // <-- provider registration
entryComponents: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule {
}
뭐가 잘못 되었습니까? 이것은 나에게 괜찮은 것 같아 – trichetriche
콘솔에 오류가 있습니까? 그렇다면 pls 그들을 게시 할 수 있습니다. – Dhyey