Gabriel Mesquita
Gabriel Mesquita

Reputation: 2391

Highchart is not showing in heroku, but works in local environment

I am using ember-highcharts in my app. I tested in my localhost and it is working fine, the graphic is showing in the screen.

I deployed my application in heroku, and try to show the graphic but the error below appears:

Uncaught TypeError: Cannot read property 'parentGroup' of undefined
at object.setState (highcharts.src.js:33606)
at SVGGElement. (highcharts.src.js:33080)

Here is my code:

{{#if question.chartData}}
  {{high-charts content=question.chartData chartOptions=chartOptions}}
 {{else}}
  <div class="modal__warning">Dados insuficientes</div>
{{/if}}

chartOptions: {
chart: {
  plotBackgroundColor: null,
  plotBorderWidth: 0,
  plotShadow: false
},
title: {
  text: null
},
tooltip: {
  pointFormat: '<b>{point.percentage:.1f}%</b>'
},
plotOptions: {
  pie: {
    colors: [
      '#60E0A1',
      '#F19692',
      '#d5d5d5',
      '#68599D',
      '#A69BC5'
    ],
    dataLabels: {
      enabled: false
    },
    size: '100%',
    showInLegend: true,
    startAngle: -90,
    endAngle: 90,
    center: ['50%', '100%']
  }
},
yAxis: {
  title: {
    text: null
  }
 }
}

Does anyone know what the problem could be? Just remember that in my local machine is working fine!

Thanks in advance :)

Upvotes: 2

Views: 204

Answers (1)

Gabriel Mesquita
Gabriel Mesquita

Reputation: 2391

I've discovered the issue. What happened is that the data that I was sending to Highcharts was using an incorrect format.

I am plotting a pie chart, and the data should be in the format below:

[ ["test", 10.0], ["test2", 85.0], ["test3", 5.0] ]

And I was sending the data like this:

{ {"test", 10.0}, {"test2", 85.0}, {"test3", 5.0} }

For some reason this caused the problem mentioned.

Upvotes: 1

Related Questions