4
我使用extjs圖表系列繪製了一個圓形儀表。我想說明量表的價值,但我沒有成功。有人可以幫助我嗎?在Extjs的圓形儀表圖表中間添加圖例
這裏是我試過的代碼:
{
xtype: 'polar',
width: 60,
height: 60,
background: '#00c6c9',
style: {left:0, right:0},
series: {
type: 'gauge',
minimum: 0,
maximum: 30,
value: 10,
colors: ['#25a2b6', 'lightgrey'],
donut: 75,
background: '#00c6c9',
totalAngle: Math.PI * 2,
style: {left:0, right:0},
needleLength: 100
/*,
renderer: function(sprite, record, attributes, index, store) {
var sprite2 = Ext.create('Ext.draw.Sprite', {
type: 'text',
text: Math.floor(attributes.value),
font: '16px Arial',
x: 30,
y: 30
});
sprite2.show(true);
return attributes;
},
label: {
field: 'value',
display: 'middle'
}*/
}
}
我只是想顯示值「10」的系列產品。在評論中你可以看到我試圖添加一個渲染器函數和一個標籤屬性。在這個標籤中,我想我不能寫「field:'value'」,但由於我不需要定義一個字段,所以我不知道要使用什麼。
非常感謝
您可以創建其他的事情爲此撥弄。你可以在這裏加強。 https://fiddle.sencha.com/#fiddle/1hp6 – UDID
當然,這裏是:https://fiddle.sencha.com/#fiddle/1hpa – melanie