How can import to angular 6 component
Closed this issue · 4 comments
enaide commented
Please somebody help me, how can import this components for angular 6, with out import form index.html directly bat from particular component
this component look perfect for me.
kluverua commented
Can you try to copy this code and paste it right after the main chartjs library code?
enaide commented
yes bat don't working throw exception
kluverua commented
Send me file that throw exception and all depend files
artem-galas commented
@enaide
You have to add Gauge.js
to you project (any directory)
Then you have to extend ChartDataSets
and ChartOptions
interfaces. For that - create file chartjst-extention.d.ts
and put next code:
import { Chart, ChartDataSets, ChartOptions } from 'chart.js';
declare module 'chart.js' {
interface ChartDataSets {
gaugeData?: any;
gaugeLimits?: any;
}
interface ChartOptions {
showMarkers?: boolean;
}
}
In your component import CharJs and Gauge.js
for example
import { Chart } from 'chart.js';
export * from '~/framework/util/Gauge';