Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting error#17 from highcharts while using solid gauge from backbone rails

I am trying to use "solidgauge" chart from highcharts in backboneJS. Previously I had used a VU meter and it was working correctly. When I used solid gauge I am getting highcharts#17 error. As per this error either I am giving series.type or chart.type wrong else I don't have the necessary extension files. I have loaded the "highcharts.js", "highcharts-more.js", "highcharts-3d.js" and "exporting.js" files and the sibling VU meter worked.So i think there is something wrong with my chart options but can't seem to figure out what that is.Here is my chart configuration and I am giving the data for the series dynamically.I am using coffeescript.

scoreCard :
 chart: 
  type: 'solidgauge'
 title: null
 pane: 
  center: ['50%', '85%']
  size: '140%'
  startAngle: -90
  endAngle: 90
  background: 
   backgroundColor: (Highcharts.theme &&                 Highcharts.theme.background2) || '#EEE'
   innerRadius: '60%'
   outerRadius: '100%'
   shape: 'arc'
 tooltip:
   enabled: false
 yAxis: 
   min: 0
   max: 100
   stops: [
        [10, '#55BF3B'] 
        [60, '#DDDF0D'] 
        [90, '#DF5353'] 
  ]
   lineWidth: 0,
   minorTickInterval: null,
   tickPixelInterval: 400,
   tickWidth: 0,
   title: 
     y: -70
   labels: 
     y: 16

 plotOptions: 
   solidgauge: 
     dataLabels: 
       y: 5
       borderWidth: 0
       useHTML: true
 credits:
  enabled: false
 series: [
   {
    name: "Pulse value"
   }
 ]

I cant seem to figure out whether the fault is because of the chart configuration or any missing header file. Can anyone please help?

like image 784
Nikhil Gopinath Avatar asked May 19 '16 12:05

Nikhil Gopinath


1 Answers

The solidgauge type has its own module that needs to be included, it's not part of the highcharts-more.js file.

As seen in the demo for the solidgauge chart:

  • http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/highcharts/demo/gauge-solid/

Files and reference:

  • https://code.highcharts.com/modules/solid-gauge.js

  • https://code.highcharts.com/

like image 119
jlbriggs Avatar answered Oct 31 '22 13:10

jlbriggs