How to use the chart.js.Chart function in chart

To help you get started, we’ve selected a few chart examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ukon1990 / wow-auction-helper / client / src / app / components / sellers / seller-chart / seller-chart.component.ts View on Github external
setChart(data: Array): void {
    if (this.chart) {
      this.chart.destroy();
    }
    this.chart = new Chart('chart', {
      type: this.chartTypeForm.value,
      data: {
        datasets: [{
          data: this.itemClasses.map(c => c.quantity),
          backgroundColor: this.colors
        }],
        labels: this.itemClasses.map(c => `${ c.name } x ${c.quantity}`)
      }
      // options: options
    });
  }
github abritopach / ionic-surveyjs / src / components / chart / chart.ts View on Github external
createDoughnutChart() {
    this.myChart = new Chart(this.chartCanvas.nativeElement, {
      type: 'doughnut',
      data: {
        labels: this.getLabels(),
        datasets: [{
          label: 'Resultados',
          data: this.getValues(),
          backgroundColor: this.backgroundColor,
          hoverBackgroundColor: this.hoverBackgroundColor
        }]
      }
    });
  }
github naver / pinpoint / web / src / main / webapp / v2 / src / app / core / components / agent-admin-chart / agent-admin-chart.component.ts View on Github external
private initChartObj() {
        this.chartObj = new Chart(this.el.nativeElement.getContext('2d'), {
            type: 'horizontalBar',
            data: this.makeDataOption(),
            options: this.makeNormalOption()
        });
    }
    private makeDataOption(): any {
github mconway / firefly-app / src / pages / piggybanks / piggybanks.ts View on Github external
ionViewDidLoad(){
      this.chart = new Chart(this.progressChart.nativeElement, {
        type: 'doughnut',
        data: {
          datasets: [{
            data: [this.piggy.percentage, 100 - this.piggy.percentage],
            backgroundColor: [
              "#00FF00"
            ]
          }],
          
        }
      });
    }
  }
github Ninja-Squad / globe42 / frontend / src / app / chart / chart.component.ts View on Github external
private createChart() {
    if (this.chart) {
      this.chart.destroy();
    }
    if (this.canvas) {
      const ctx = this.canvas.nativeElement;
      this.chart = new Chart(ctx, this.configuration);
    }
  }
}
github ukon1990 / wow-auction-helper / client / src / app / components / charts / charts.component.ts View on Github external
setChart(): void {
    if (this.chart) {
      this.chart.destroy();
    }
    this.chart = new Chart(this.storageName, this.getChartConfig());
  }
github valor-software / ng2-charts / projects / ng2-charts / src / lib / base-chart.directive.ts View on Github external
public getChartBuilder(ctx: string/*, data:any[], options:any*/): Chart {
    const chartConfig = this.getChartConfiguration();
    return new chartJs.Chart(ctx, chartConfig);
  }

chart

event based time series charting API

Unknown
Latest version published 12 years ago

Package Health Score

39 / 100
Full package analysis

Popular chart functions