为什么下列数据产生错误的图表? [英] Why the following data produce wrong chart?

查看:194
本文介绍了为什么下列数据产生错误的图表?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用graphael的线条。

I am using linegraph of graphael.

我有这条线来产生我的图

I have this line to produce my graph

    var lines = r.linechart(30, 30, 600, 440,[[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71]],[[0.03091,0.00461,0.0068,0.00144,0.00544,0.00035,0.00871,0.03117,0.02259,0.02623,0.01967,0.01967,0.00788,0.02217,0.0137,0.01237,0.01764,0.0131,0.00942,0.0076,0.01463,0.02882,0.02093,0.02502,0.01961,0.01551,0.02227,0.0164,0.0191,0.00774,0.03076,0.0281,0.01338,0.02763,0.02334,0.00557,0.00023,0.01523,0.0263,0.03077,0.02404,0.02492,0.01954,5E-05,0.02337,0.01715,0.02271,0.00815,0.01343,0.00985,0.01837,0.00749,0.02967,0.01156,0.0083,0.00209,0.01538,0.01348,0.01353,0.02163,0.00977,0.02401,0.01207,0.01485,0.02717,0.02327,0.00629,0.01195,0.03052,0.00812,0.01215,0.00241]], {nostroke: false, axis: "0 0 1 1", symbol: "circle", smooth: true })

然而,上述数据使得graphael图在生成图时在y轴上有错误的标签。你能帮助我吗?我昨天被困在这个东西...

However, the above data, make the graphael graph, to have wrong labels at the y axis when the graph is produced. Can you help me with that? I am stuck since yesterday at this thing...

至少可以有人运行它,只是告诉我,如果他能正常运行?

At least can anyone run it, just to tell me if he can run it normally?

推荐答案

您不是第一个遇到此问题的人。

我建议将您的值乘以10或100,这应该可以解决问题,并且可以很容易地在图表图例中显示。

I would recommend to multiply your value by 10 or 100, which should solve the problem and could be easily presented in the chart legend.

例如:

data = [0.03091,0.00461,0.0068,0.00144,0.00544,0.00035,0.00871,0.03117,0.02259,0.02623,0.01967,0.01967,0.00788,0.02217,0.0137,0.01237,0.01764,0.0131,0.00942,0.0076,0.01463,0.02882,0.02093,0.02502,0.01961,0.01551,0.02227,0.0164,0.0191,0.00774,0.03076,0.0281,0.01338,0.02763,0.02334,0.00557,0.00023,0.01523,0.0263,0.03077,0.02404,0.02492,0.01954,5E-05,0.02337,0.01715,0.02271,0.00815,0.01343,0.00985,0.01837,0.00749,0.02967,0.01156,0.0083,0.00209,0.01538,0.01348,0.01353,0.02163,0.00977,0.02401,0.01207,0.01485,0.02717,0.02327,0.00629,0.01195,0.03052,0.00812,0.01215,0.00241];

data = data.map(function(x) { return x * 1000; });

r.linechart(30, 30, 600, 440,[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71],data, {nostroke: false, axis: "0 0 1 1", symbol: "circle", smooth: true })

似乎是解决方法。

这篇关于为什么下列数据产生错误的图表?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆