EzekielZhang / ichartjs

Automatically exported from code.google.com/p/ichartjs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

当data的value数组的长度与label的数组长度不一致时,数值是撑开到整个label显示的

GoogleCodeExporter opened this issue · comments

问题描述,描述当出现bug时的步骤?
1.data的value数组默认是12个值,lable的数组是一年的12个月
2.假设我只有前四个月的数据,那么显示的会是 
这四个数据不是在一到四个月,而是撑开了第四个月的值到��
�12月
3.我现在的解决方案是给后面八个月的值都设为0,但可不可��
�后面没有值就直接不显示下去了
操作系统(包括版本)?
 移动开发  ipad
浏览器(包括版本)?

使用的ichartjs版本?
ichartjs 1.1
出现bug时的关键代码?
var 
json='[{"name":"达成值","color":"#4572a7","line_width":2,"value":["12","23","
1","56"]},{"name":"去年同期值","color":"red","line_width":2,"value":["12","
23","11","6"]},{"name":"计划值","color":"green","line_width":2,"value":["2","
23","21","6"]}]';

                        var data1=JSON.parse(json);

                        var labels = ["2012-01","201202","201203","201204","201205","201206","201207","201208","201209","201210","201211","201212"];
                        var line = new iChart.LineBasic2D({
                            render : 'canvasDiv1',
                            data: data1,
                            align:'center',
                            title:{
                                text:'业绩趋势',
                                color:'#ff5000'
                            },
                            width : 838,
                            height : 300,
                            border:false,
                            tip:{
                                enable:true,
                                shadow:true
                            },
                            legend : {
                                enable : true,
                                row:1,//设置在一行上显示,与column配合使用
                                column : 'max',
                                valign:'top',
                                sign:'bar',
                                offsetx:-80,//设置x轴偏移,满足位置需要
                                offsety:-20,
                                border : false
                            },
                            crosshair:{
                                enable:true,
                                line_color:'#62bce9'
                            },
                            coordinate:{
                                width:838,
                                height:240,
                                axis:{
                                    color:'#c0c0c0',
                                    width:[0,0,1,0]
                                },
                                scale:[{
                                     position:'left',   
                                     start_scale:0,
                                     end_scale:100,
                                     scale_space:10,
                                     scale_size:2,
                                     scale_color:'#c0c0c0'
                                },{
                                     position:'bottom', 
                                     labels:labels
                                }]
                            }
                        });

其他信息




Original issue reported on code.google.com by lakersya...@gmail.com on 13 May 2013 at 3:32