Coder Social home page Coder Social logo

Comments (12)

SarraMrbt avatar SarraMrbt commented on June 22, 2024 9

import ChartModule in your Module

from angular-highcharts.

remster85 avatar remster85 commented on June 22, 2024 5

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.

cebor avatar cebor commented on June 22, 2024 4

Do you import and bind ChartModule ?

from angular-highcharts.

clsatw avatar clsatw commented on June 22, 2024 1

i got the same problem. can anyone help please.

from angular-highcharts.

jyotiranjankalta81 avatar jyotiranjankalta81 commented on June 22, 2024 1

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.

Janatbek avatar Janatbek commented on June 22, 2024

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.

clsatw avatar clsatw commented on June 22, 2024

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.

clsatw avatar clsatw commented on June 22, 2024

basically my code is exactly the same as yours.

from angular-highcharts.

Janatbek avatar Janatbek commented on June 22, 2024

from angular-highcharts.

clsatw avatar clsatw commented on June 22, 2024

from angular-highcharts.

clsatw avatar clsatw commented on June 22, 2024

from angular-highcharts.

clsatw avatar clsatw commented on June 22, 2024

from angular-highcharts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.