开发者

Ext js4 gauge chart and setValue

I'm try开发者_C百科ing to setup a gauge chart in extjs 4 that should be feeded from a "static" value calculated from data.Store data.

The calculated data is obtained in a datachange listener in the store.

I read about the setValue method but i really did not understand how to use it, can anyone give me some hint?

Thanks to all, N


After banging my head to the wall for some hours, I just found out how it works. And it was oh so obvious:

// the value that you want to set up
var newValue = 35;
// a reference to the chart
var chart = Ext.getCmp('myChartId');
// setting the value
chart.series.items[0].setValue(newValue)

Notice that setValue is within chart.series.items[0]. This is because, as conter-intuitive as it may sound, Gauge is NOT a type of chart but a type of series.

Hope this helps other newbies of Ext like me, because the documentation could really use some more examples!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜