当年龄范围差异很大时,如何缩放图表上的数据以便更好地查看?
我正在尝试使用 Java Swing 和 JFreeChart 可视化计算机性能数据。 在一张图表上,我想显示某个进程的 CPU 负载 (%) 和用户内存。因此,CPU 的可能值为 0..100,但对于内存:从 10KB (10*1024b) 到 500MB (500*1024*1024b),差异很大。
呈现这些数据的最佳方式是什么? 谢谢你!
I'm trying to visualize computer performance data using Java Swing and JFreeChart.
On one chart I want to show CPU load (%) and user memory by some process. So, the possible values for CPU are 0..100, but for memory: from 10KB (10*1024b) to 500MB (500*1024*1024b), the difference is big.
What is the best way to present that data?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设这将是一个图表,X 轴上有时间,Y 轴上有性能指标。
在这种情况下,我会将内存显示为已用内存的百分比,而不是使用中的(千|兆|千兆)字节数。这样,它就可以叠加在 CPU(和其他性能指标)上,而不会扭曲整体规模。
我不再有开发人员指南的副本(必须从 JFree.org 购买),但我记得,JFreeChart 提供了一种向折线图上的点添加工具提示的方法。如果用户不仅仅对所用内存的百分比感兴趣,您可以使用它为用户提供一种查看正在使用的(千|兆|千兆)字节的方法。
I'm assuming this will be a graph which is has time on the X axis and performance metric on the Y axis.
This being the case, I would display the memory as % of memory used instead of the number of (kilo|mega|giga)bytes in use. This way it could be overlaid on the CPU (and other performance metrics) without distorting the overall scale.
I no longer have a copy of the developer guide (this must be purchased from JFree.org) but as I recall, JFreeChart offers a way to add a tool-tip to points on a line graph. You could use this to provide the user a way to see the (kilo|mega|giga)bytes in use if they were interested in more than just the % of memory used.