PDA

View Full Version : Gauge series - setValue() does nothing



tR4x0u
13 Aug 2013, 7:24 AM
Hello everybody,

I'm using the setValue function on a chart.series.items[0] object (gauge type), but the gauge is always empty (no value visually defined).

Here's my gauge view definition:


Ext.define('MyApp.view.portlet.GaugePortlet', {
extend: 'Ext.panel.Panel',
alias: 'widget.gaugeportlet',
height: 300,
requires: [
'Ext.data.JsonStore',
'Ext.chart.theme.Base',
'Ext.chart.series.Series',
'Ext.chart.series.Line',
'Ext.chart.axis.Numeric',
'Ext.chart.*',
'Ext.chart.axis.Gauge',
'Ext.chart.series.*'
],

initComponent: function () {

Ext.apply(this, {
layout: 'fit',
items: {
xtype: 'chart',
animate: {
easing: 'elasticIn',
duration: 1000
},
store: 'GaugePortlet',
legend: {
position: 'bottom'
},
axes: [{
type: 'gauge',
position: 'gauge',
minimum: 0,
maximum: 150,
steps: 10
}],
series: [{
type: 'gauge',
// field: 'valeur',
donut: false,
colorSet: ['#F49D10', '#ddd']
}]
}
});

this.callParent(arguments);
}
});

Then in my controller, I do the following:


myChart.series.items[0].setValue(90);

It doesn't show anything except the empty gauge with no value...

Any idea please ?

Thanks in advance

scottmartin
15 Aug 2013, 7:03 AM
Have a look at the following for changing the chart value:
http://docs.sencha.com/extjs/4.2.1/#!/api/Ext.chart.series.Gauge

Scott.