Flex BarChart 长文本
在我的应用程序中,我使用条形图来显示数据。但是,类别轴中的文本可能太长而无法在图表上显示,因此 Flex 会自动调整字体大小,使数据无法读取或文本部分可见。
每次新数据进入时,文本的长度都会发生变化,因此我无法在运行时将 gutterLeft 属性设置为静态值。
我想到的两件事是:
根据新数据动态更改装订线
在类别轴上有一个滚动条,这样如果有任何文本就不会滚动适合空间,用户可以滚动查看它
任何帮助将不胜感激。
编辑: 我同时绘制了数百行数据,因此我无法真正为每个项目使用图例。
另外,我不知道如何使用动作脚本更改 gutterLeft 属性。在 MXML 中执行此操作非常简单,
gutterLeft="100"
但我无法使用操作脚本访问该属性。我还尝试将 gutterLeft 变量绑定到一个整数并更改该整数,但它仍然不起作用。 :|
In my application, I am using a BarChart to display data. However, the text in the category axis can be too long to display on the chart, so flex adjusts the font size automatically to the point that the data is either unreadable, or the text is partially visible.
The length of the text varies every time new data comes in, so I can't set the gutterLeft attribute to a static value at runtime.
Two things that come to my mind are:
Change the gutter dynamically according to new data
Have a scroll bar on the categoryaxis so that if any text won't fit in the space, the user can scroll to see it
Any help would be appreciated.
EDIT:
I have hundreds of rows of data being graphed at once, so I can't really use a legend for each item.
Also, I have no idea how to change the gutterLeft property with actionscript. Doing it in MXML is as simple as
gutterLeft="100"
but I cannot access the property using actionscript. I also tried to bind the gutterLeft variable to an integer and change that integer and it still didn't work. :|
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是gutterleft是一种样式,因此在使用actionscript时需要将其设置为一种样式。
我希望看到您的代码给出更详细的答案,但您想要做的是:
the problem is that gutterleft is a style, and therefor needs to be set as one when using actionscript.
I was hoping to see your code to give a more detailed answer but what you want to do is: