English 中文(简体)
升级至最近的角 18, Nsg- serve 上 nsg- serve 出现 ng2- 图表错误
原标题:Upgrading to latest angular 18 with ng2-charts errors on nsg-serve
Upgrading angular 18 with ng2-charts 6.0.1 on running n-serve throws error as below imports ng2-charts, chart.js,chartjs-plugin-annotation. nothig helps and throws error. I am trying to use in npn -standard component which is child component for other modules. X [ERROR] NG8002: Can t bind to type since it isn t a known property of canvas . [plugin angular-compiler] src/app/shared/tt-chart/tt-chart.component.html:64:32: 64 │ ...
最佳回答
Go through each of the error component and apply the below approach ( This errors happens when the BaseChartDirective is not imported ). If task component is standalone, add BaseChartDirective to the imports array. import { BaseChartDirective } from ng2-charts ; ... ... @Component({ standalone: true, imports: [ ... BaseChartDirective, ... ], ... }) export class TaskComponent { ... If the task is not standalone, go to the place where you delared the component declarations array. Then import FormModule. import { BaseChartDirective } from ng2-charts ; ... ... @NgModule({ ... imports: [ ... BaseChartDirective, ... ] ... }) export class SomeModule {} Also ensure you main.ts has the below code. import { provideCharts, withDefaultRegisterables } from ng2-charts ; bootstrapApplication(AppComponent, { providers: [provideCharts(withDefaultRegisterables())], }).catch((err) => console.error(err)); The official npm docs provides you step by step on how to configure.
问题回答

暂无回答




相关问题
Reporting Services Pie Chart

The pie chart is driving me nuts...Excuse me if I sound ignorant but I have figured out the other RS charts with relative ease, and this is the first time I have had to use the Reporting Services pie ...

ASP:Chart control - databind pie chart from datatable

I ve got a datatable with two columns "Status" (string) and "Total" (integer). Status Total Success 34 Missing 2 Failed 10 I want to databind this into a pie chart with ...

WPF Toolkit Pie Chart Style Colors

i`d like to set colors in codebehind for every Pie Slice in my PieChart. Anyone knows how to do this? Now it gets the colors from the styles xaml, but i need to assign the colors for each value (pie ...

How to Fill the gradient color in JFreeChart PieChart3D?

I want to fill the PieChart3D with a gradient color, I am using JFreeChart for drawing the graph. but it is not filling with gradient color rather than it is filled with a solid color.. Here is the ...

How to apply seriesStyles to piechart in ExtJs dynamically

Am trying to set seriesstyles to piechart dynamically from the JSON data. When the oneWeekStore loads the JSON data, I wish to iterate through the color of each record and setSeriesStyles ...

rmagick or other library for producing 3D pie chart

I am interested in making a 3D pie chart dynamically on my page depending on values pulled from my database. The chart would only be updated every few days, so I don t mind a process intensive task as ...

MS pie chart with 2 querys

i have two queries which give two different values One query gives the freespace select sum(freesize) as freespace from freespace the next query gives totalspace select sum(NumRegions) as ...

热门标签