question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't bind to 'chart' since it isn't a known property of 'div'

See original GitHub issue

I just installed angular-highcharts and highcharts, did everything that was documented to start basic chart. But I ma getting this error:

Uncaught Error: Template parse errors:
Can't bind to 'chart' since it isn't a known property of 'div'. ("
  <button (click)="add()">Add Point!</button>
  <div [ERROR ->][chart]="chart"></div>
  "): ng:///EDLModule/EDLComponent.html@2:7
    at syntaxError (compiler.es5.js:1694)
    at TemplateParser.webpackJsonp.../../../compiler/@angular/compiler.es5.js.TemplateParser.parse (compiler.es5.js:12937)
    at JitCompiler.webpackJsonp.../../../compiler/@angular/compiler.es5.js.JitCompiler._compileTemplate (compiler.es5.js:27133)
    at compiler.es5.js:27052
    at Set.forEach (<anonymous>)
    at JitCompiler.webpackJsonp.../../../compiler/@angular/compiler.es5.js.JitCompiler._compileComponents (compiler.es5.js:27052)
    at compiler.es5.js:26939
    at Object.then (compiler.es5.js:1683)
    at JitCompiler.webpackJsonp.../../../compiler/@angular/compiler.es5.js.JitCompiler._compileModuleAndComponents (compiler.es5.js:26938)
    at JitCompiler.webpackJsonp.../../../compiler/@angular/compiler.es5.js.JitCompiler.compileModuleAsync (compiler.es5.js:26867)

below is my component:

import { Chart } from 'angular-highcharts';

@Component({
  selector: 'app-edl',
  template: `
  <button (click)="add()">Add Point!</button>
  <div [chart]="chart"></div>
  `
  
})
export class EDLComponent extends BaseWidget {
   /**
   * testing highcharts here
   */
  chart = new Chart({
    chart: {
      type: 'line'
    },
    title: {
      text: 'Linechart'
    },
    credits: {
      enabled: false
    },
    series: [{
      name: 'Line 1',
      data: [1, 2, 3]
    }]
  });

// add point to chart serie
  add() {
    this.chart.addPoint(Math.floor(Math.random() * 10));
  }
}

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:12 (1 by maintainers)

github_iconTop GitHub Comments

9reactions
SarraMrbtcommented, Sep 30, 2018

import ChartModule in your Module

4reactions
remster85commented, Jul 15, 2019

Resolution is

// app.module.ts
import { ChartModule } from 'angular-highcharts';
 
@NgModule({
  imports: [
    ChartModule // add ChartModule to your imports
  ]
})
export class AppModule {}

as described in https://www.npmjs.com/package/angular-highcharts#usage-example

Read more comments on GitHub >

github_iconTop Results From Across the Web

Can't bind to 'options' since it isn't a known property of 'chart'
You can set import the HighChartsModule in the IonicPageModule in which it is used instead of the app.module.ts
Read more >
Common errors in Angular: Can't bind to since it isn't a known ...
Ever made an Angular application , opened your console and saw an error message similar to: “Can't bind to ngclass since it isn't...
Read more >
Can't bind to 'chartType' since it isn't a known property of
I'm trying to put a pie chart in my page using the mdb, but i receive: Can't bind to 'chartType' since it isn't...
Read more >
can't bind to 'options' since it isn't a known property of 'canvas'.
Normally, this error occurs when you missed some imports. Please add these line if missing: import { FormsModule, ReactiveFormsModule } ...
Read more >
can't bind 'canvasjs-chart' in Angular
html:2:19 – error NG8002: Can't bind to 'options' since it isn't a known property of 'canvasjs-chart'. 1. If 'canvasjs-chart' is an Angular ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found