在 Flex 图表中对齐多个图表
我在 Flex Charting (3.x) 中有多个折线图。 图表(以及图表数量)是动态生成的,并且是“A 型”或“B 型”。 Y 轴上的数据类型对于类型 A 和类型 B 来说是不同的。x 轴是时间。
每个图表都放置在其自己的 VBox(以及一些其他内容)中,这些 VBox 构成了 A 型或 B 型的更大画布。该 VBox 被赋予绝对 X 位置。
将不同的图表排列起来是非常重要的,以便可以进行(及时)比较。
最终发生的情况是,某些图表的垂直轴比其他图表占据更多的宽度,因此图表不再及时对齐。
我尝试播放 VerticalAxisRenderers/AxisRenderer
宽度,但没有效果。
任何建议将不胜感激。
I have multiple line charts in Flex Charting (3.x). The charts (and number of charts) are being dynamically generated, and are either of "type A" or "type B." The type of data on the Y-axis is different for type A then it is for type B. The x-axis is time.
Each chart is placed in its own VBox (with a few other things) that make up a larger canvas of the Type A or Type B. This VBox is given an absolute X position.
It is very high priority that the different charts line up, so that comparisons (in time) can be made.
What ends up happening is that the vertical axis for some charts takes up more width then others, so the charts are no longer aligned in time.
I have tried playing the VerticalAxisRenderers/AxisRenderer
width, but that had no effect.
Any advice would be greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以尝试为两个图表设置相同的装订线。 这可能有帮助。 我有类似的问题,但还没有找到更好的答案。
You can try to set the same gutter left for the both charts. That might help. I had a similar issues, but haven't figured a better answer yet.
我也在做同样的事情。 如果您可以使用相同的 HorizontalAxis 使用 DateTime 轴,那么效果很好......您只需将数据解析为适当的 dateTime 即可。
但是,如果像我一样,您需要绘制时间图表,并将时间值解析为日期时间,然后提供数据间隙...到目前为止,我还没有找到答案,因为我使用的是水平轴 - 类别轴,但是我将尝试将其切换为数字轴,并让您知道我的想法。 如果有什么...
I am doing the same thing. If you can use the same HorizontalAxis using a DateTime axis it works great.. you just need to parse the data into an appropriate dateTime.
But, if like me, you need to chart the Time and a parsing the Time values into datetime then provides gaps in data... so far, I have not found an answer, because I am using a Horizontal Axis - Category Axis, but I will try switching that to a Numeric Axis and let you know what I come up with. if anything...
您需要确保组件使用相同的宽度、高度、填充和装订线设置。
对于解决您所描述问题的装订线,您可以在此处找到正确的信息和示例代码:
You need to make sure the component uses the same width, height, padding and gutter settings.
For the gutter, which solves what you described, you can find the right info and sample code here: