extjs 3.0 linechart 的一个奇怪的问题。
我按照网上的例子,搞定了折线图的显示,
但是当所有数值都小于0.5的时候,不显示了。
有没有高手知道这是怎么回事??
代码如下:
[code="java"]
Ext.onReady(function(){
var data= [
{name:'Jul 07', visits: 0.001, views: 0.002},
{name:'Aug 07', visits: 0.002, views: 0.002},
{name:'Sep 07', visits: 0.003, views: 0.003},
{name:'Oct 07', visits: 0.004, views: 0.004},
{name:'Nov 07', visits: 0.005, views: 0.001},
{name:'Dec 07', visits: 0.006, views: 0.002},
{name:'Jan 08', visits: 0.007, views: 0.003},
{name:'Feb 08', visits: 0.008, views: 0.001} ]
var store = new Ext.data.Store({
proxy: new Ext.data.MemoryProxy(data),
reader: new Ext.data.JsonReader({},
[{name: 'name'},
{name: 'visits',type:'float'},
{name: 'views',type:'float'} ])});
store.load();
// extra extra simple
new Ext.Panel({
title: 'ExtJS.com Visits Trend',
applyTo: 'container',
width:500,
height:300,
layout:'fit',
items:{
xtype: 'linechart',
store: store,
xField: 'name',
listeners: {
itemclick: function(o){
var rec = store.getAt(o.index);
Ext.example.msg('Item Selected', 'You chose {0}.', rec.get('name')); } },
series: [{//列
type: 'line', //类型可以改变(线)
displayName: 'Visits',
yField: 'visits',
style: {
color:0xE1E100
}
}] } });});
[/code]
上面这样是不能显示的,只有将其中某个数值改成大于0.5就可以正常显示了。
高手,快来吧,等你解答啦~~~