Comments (12)
import ChartModule in your Module
from angular-highcharts.
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
from angular-highcharts.
Do you import and bind ChartModule
?
from angular-highcharts.
i got the same problem. can anyone help please.
from angular-highcharts.
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)); } }
ERROR in src/app/modules/checklist/checklist.component.html:58:10 - error NG8002: Can't bind to 'chart' since it isn't a known property of 'div'.
58 <div [chart]="chart"></div>
~~~~~~~~~~~~~~~
src/app/modules/checklist/checklist.component.ts:34:16
34 templateUrl: './checklist.component.html',
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Error occurs in the template of component ChecklistComponent.
from angular-highcharts.
I got it working, but show me your code. you can push your code to github, open an issue on your code. and share with me
from angular-highcharts.
Hi Janatbek,
Here are my code:
<button ion-button (click)="add()">Add Point!</button>
<div [chart]="chart"></div>
import { NgModule, Component } from '@angular/core';
import { AngularFireList } from 'angularfire2/database';
import { Chart } from 'angular-highcharts';
// import {FirebaseProvider} from '/providers/firebase/firebase.ts';
import { Observable } from 'rxjs/Observable';
import { FirebaseProvider } from '../../providers/firebase/firebase';
import { DhtLog } from '../../app/shared/dhtlog.model';
/**
* Generated class for the Dth11ListComponent component.
*
* See https://angular.io/api/core/Component for more info on Angular
* Components.
*/
@Component({
selector: 'dht11-list',
templateUrl: 'dht11-list.html'
})
export class Dht11ListComponent {
dhtLogs$: Observable<DhtLog[]>;
dhtLogList: AngularFireList<DhtLog>;
// chart: Chart;
chart = new Chart({
chart: {
type: 'line'
},
title: {
text: 'Linechart'
},
credits: {
enabled: false
},
series: [{
name: 'Line 1',
data: [1, 2, 3]
}]
});
add() {
this.chart.addPoint(Math.floor(Math.random() * 10));
}
constructor(private dhtLogSvc: FirebaseProvider) {
console.log('ionViewDidLoad Log component');
this.dhtLogs$ = this.dhtLogSvc.getDhtData();
}
ionViewDidLoad() {
console.log('ionViewDidLoad Log component');
let x = this.dhtLogSvc.getData();
}
}
thank you.
from angular-highcharts.
basically my code is exactly the same as yours.
from angular-highcharts.
from angular-highcharts.
from angular-highcharts.
from angular-highcharts.
from angular-highcharts.
Related Issues (20)
- Thanks everyone and wish you all the best for the holiday season. HOT 1
- StockChart doesn't contain getSVG() method HOT 6
- CommonJS or AMD dependencies Warning HOT 1
- Cannot read property 'showLoading' of undefined
- activate plugin
- angular 13 incompatible HOT 1
- Is it possible to toggle full screen using a separate button. I am using Stock Chart?
- How to resize stock chart HOT 1
- Angular Server-side rendering (SSR) - issue
- Pie chart in lower to higher all datalabels not displayed in chart view (Opera, QQ, Other) datalable not available
- Cannot read properties of undefined (reading 'forExport')
- How it differs from highcharts-angular?
- Angular 15 incompatibility HOT 1
- Update flag adds new legend elements
- No peer dependency mentioning highcharts
- Angular 16 Compatibility - Error HOT 7
- Support for Angular v17 HOT 3
- [Bug] HighchartsGantt class HOT 1
- Add support ESbuild imports HOT 4
- ref$ not supported ? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from angular-highcharts.