cetinDev
cetinDev

Reputation: 319

ionic 2 highchart not visible

image

I added highchart looking Page source but not visible on page

I followed this https://www.youtube.com/watch?v=FSg8n5_uaWs

how can ı solve this problem

my codes;

ts;

export class VerilerPage {

  chartOptions : any;
  constructor(public navCtrl: NavController, public navParams: NavParams) {
    this.chartOptions={
       chart: {
            type: 'bar'
        },
        title: {
            text: 'Fruit Consumption'
        },
        xAxis: {
            categories: ['Apples', 'Bananas', 'Oranges']
        },
        yAxis: {
            title: {
                text: 'Fruit eaten'
            }
        },
        series: [{
            name: 'Jane',
            data: [1, 0, 4]
        }, {
            name: 'John',
            data: [5, 7, 3]
        }]
    }
  }

html;

<chart options="chartOptions" type="chart" ></chart>

Upvotes: 2

Views: 123

Answers (1)

Vivz
Vivz

Reputation: 6630

Since you are using angular 2/4, you have to enclose options with []

<chart [options]="chartOptions" type="chart" ></chart>

Upvotes: 2

Related Questions