在extjs 4.1.1a中,下面的代码是折线图的工作示例.现在我需要在给定的最小和最大时间戳上突出显示该图表的一部分.
{'xtype' : 'chart',
'store' : 'ChartData',
'height' : '100%',
'width' : '100%',
'legend' : {'position' : top},
'axes': [{
'title': 'Power',
'type': 'Numeric',
'position': 'left',
'fields': ['power']
},{
'title': 'Timestamp',
'type': 'Numeric',
'position': 'bottom',
'fields': ['timestamp'],
'minorTickSteps': 3
}],
'series': [{
'type': 'line',
'fill': true,
'axis' : 'left',
'xField': 'timestamp',
'yField': 'power'
}]}
Run Code Online (Sandbox Code Playgroud)
我搜索了sencha论坛,发现什么都没有符合我的要求.现在我设法使用自定义渲染器更改折线图上的点的颜色.
'renderer': function(sprite, record, attr, index, store) {
var item = store.getAt(index);
if(item != undefined && (item.get('timestamp') < startdate || item.get('timestamp') > enddate)){
return Ext.apply(attr, …
Run Code Online (Sandbox Code Playgroud)