从文本文件生成具有 2 Y 值的图形
我重新制作了原来的帖子,因为它的格式非常糟糕。基本上我想要一些关于如何生成带有 2 Y 轴(温度和湿度)的折线图以显示文本文件中的一些信息的建议/提示。它包含在一个名为 tempdata.txt 的文本文件中,我在 JpGrapher 论坛中包含了我的一篇帖子的链接,只是因为它能够清晰地显示代码。
我知道因为这是 JpGraph 问题,所以我不应该在这里发帖,但是这里的社区更加支持和活跃。非常感谢您提前提供的所有帮助!
I have remade my original post as it was terribly formatted. Basically I would like some advice / tips on how to generate a line graph with 2 Y Axis (temperature and humidity) to display some information from my text file. It is contained in a textfile called temperaturedata.txt I have included a link to one of my posts from the JpGrapher forum only because it is able to display the code clearly.
I understand that since it is JpGraph problem I shouldn't post here however the community here is a lot more supportive and active. Many thanks for all your help guys in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不认为您有任何理由不应该在这里发布有关 jpgraph 的文章。我也不明白为什么您不应该在此处发布示例代码和数据。
您在其他网站上发布的代码已损坏。检查#42 行。
此外,您通过
$keyval
向 JpGraph 传递一行(特别是最后一行)。$data
是存储所有数据的位置,尽管格式错误。一个非常快速的修复方法是:调换
$data
并将其重命名为$keyval
。 (过去将时间数据保存在$data[x]['time']
中,现在将其保存在$keyval['time'][x]
中。 )我们传递$keyval['Temperature']
,它是一个简单的温度值数组。I don't see any reason why you shouldn't post here about jpgraph. And I don't see why you shouldn't post your sample code and data here, either.
The code you've posted on the other site is broken. Check line #42.
Furthermore, you're passing JpGraph a single row (specifically, the last row) via
$keyval
.$data
is where all your data is stored, though in a wrong format. A very quick fix was:which transposed
$data
and renamed it$keyval
. (Where it used to hold time data in$data[x]['time']
, it now holds it in$keyval['time'][x]
.) And we're passing$keyval['temperature']
, which is a simple array of temperature values.