Note that there are some explanatory texts on larger screens.

plurals
  1. POhighcharts, gauge chart, update on slider
    primarykey
    data
    text
    <p>I Want to update gauge chart on move of slider, it should be continuous, but when I try to update it on move of slider the movement is very slow and sluggish </p> <p><strong>HTML</strong></p> <pre><code>&lt;script src="http://code.highcharts.com/highcharts.js"&gt;&lt;/script&gt; &lt;script src="http://code.highcharts.com/highcharts-more.js"&gt;&lt;/script&gt; &lt;div id="container" style="min-width: 310px; max-width: 400px; height: 300px; margin: 0 auto"&gt;&lt;/div&gt; &lt;div id="slider"&gt;&lt;/div&gt; &lt;div id="slider-val" style="border:1px solid #000; display:inline"&gt;75&lt;/div&gt; </code></pre> <p><strong>JAVASCRIPT</strong></p> <pre><code>function updateGaugeChart(chart, value){ var point = chart.series[0].points[0]; var newVal = value; point.update(newVal); } $(function () { var chartObj = { chart: { type: 'gauge', renderTo:"container" }, pane: { startAngle: -150, endAngle: 150 }, // the value axis yAxis: { min: 0, max: 200, minorTickInterval: 'auto', minorTickWidth: 1, minorTickLength: 10, minorTickPosition: 'inside', minorTickColor: '#666', tickPixelInterval: 30, tickWidth: 2, tickPosition: 'inside', tickLength: 10, tickColor: '#666', labels: { step: 2, rotation: 'auto' }, title: { text: 'km/h' } }, series: [{ name: 'Speed', data: [80], tooltip: { valueSuffix: ' km/h' } }]}; var gaugeChartObj = new Highcharts.Chart(chartObj); $("#slider").slider({ value: 75, range: "min", min:0, max:200, animate: true, slide: function( event, ui ) { $("#slider-val").text(ui.value); updateGaugeChart(gaugeChartObj, ui.value); } }); }); </code></pre> <p><a href="http://jsfiddle.net/DYAM9/4/" rel="nofollow">JS FIDDLE DEMO</a></p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload