kluverua/Chartjs-tsgauge

How can import to angular 6 component

Closed this issue · 4 comments

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.

Can you try to copy this code and paste it right after the main chartjs library code?

yes bat don't working throw exception

Send me file that throw exception and all depend files

@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';