[英]ExtJS gauge chart series - setValue() is not a function
我有一段代码看起来像这样:
var myChart = this.items[i].items[j].down().down();
myChart.series.items[0].setValue(30);
myChart定义明确。 当我在萤火虫中监视它时,它包含图表。
我知道仪表不是图表的类型而是系列的类型,所以我真的不明白为什么会出现错误“ setValue is a function”!
如果有人可以提供帮助,那将真的很酷,因为我对此感到非常恼火。
这是我的视图定义:
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
},
legend: {
position: 'bottom'
},
axes: [{
type: 'gauge',
position: 'gauge',
minimum: 0,
maximum: 2,
steps: 10
}],
series: [{
type: 'gauge',
donut: false,
colorSet: ['#F49D10', '#ddd']
}]
}
});
this.callParent(arguments);
}
});
我现在不想使用动态存储,我只想测试设置硬编码的值。
谢谢
我终于通过在视图的afterLayout事件中使用setValue修复了此错误。
所以我的代码现在看起来像这样:
//view declaration...
listeners:
{
afterlayout: function ()
{
//use setValue here.
}
}
最终,我面临着另一个问题……萤火虫中没有更多错误,但是从视觉上看,我的仪表图没有显示任何值。 它呈现的很好,但是它是空的。...我尝试使用doLayout()或doComponentLayout()方法对其进行更新,但是仍然没有任何反应。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.