我想在extjs 4线图中显示节点值 [英] I want to show node value in extjs 4 line chart
问题描述
当我们在线图表节点上鼠标时,它显示节点值。我想完成的代码是:
When we take mouse on line chart node then it is showing nodes values. Same thing i want to permanently without pointing to node.
My complete code is:
code> items:[{
xtype:'displayfield',
value:'Avg。货运百分比'
},{
xtype:'linechart',
store:store30DaysTo180Days,
xField:'days',
height:200,
yField:'averageFreightPercentLast',
xAxis:new Ext.chart.CategoryAxis({title:'in Days',})
}]
items:[{
xtype:'displayfield',
value:'Avg. Freight Percentage'
},{
xtype: 'linechart',
store: store30DaysTo180Days,
xField: 'days',
height:200,
yField: 'averageFreightPercentLast',
xAxis: new Ext.chart.CategoryAxis({ title: 'In Days', })
}]
推荐答案
配置标签
是为此目的。尝试一下:
The config label
is for this purpose. Try something like:
series: [{
type: 'line',
axis: 'left',
markerConfig: {
type: 'cross'
},
highlight: true,
label: {
display: 'inside', // or 'rotate'
field: 'revenue',
'text-anchor': 'start'
// I found that undocumented property with values 'start', 'end' or 'middle'
},
tips: {
trackMouse: true,
width: 80,
height: 25,
renderer: function(storeItem, item) {
this.setTitle(item.value[1] + ' $</span>');
}
},
xField: 'month',
yField: 'revenue'
}]
有关更多信息,请参阅标签的文档。
For more information look at the docs for label.
不幸的是,只有很少的可能性来设计它。要获得一些好的东西,你需要使用 renderer
函数(这个真的允许你做所有你可以想到的标签)。
Unfortunately, there are only few possibilities to style it. To get something good, you need to use the renderer
function (this one really allows you to do all you can think of for a label).
这篇关于我想在extjs 4线图中显示节点值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!