asp.net 中的网络图表
正在使用 asp.net 中的 webchart 控件(http://www.carlosag.net/Tools/WebChart /)X 轴标签很长(例如 30 个字符),因此会被截断。有更好的方式来展示它们吗?
谢谢, 吉萨
Am working with webchart control in asp.net(http://www.carlosag.net/Tools/WebChart/) The X-axis labels are long(say 30 chars) and hence gets truncated. is there a better way of displaying them?
Thanks,
Geetha
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果某些图表组件较多或某些组件较长,则会自动更改 x 轴标签方向。您还应该能够以编程方式设置它。我是在使用 ChartFX 图表时完成此操作的。
some of the charting components automatically change x-axis label orientation if there are many of them or some of them are long. You should also be programmatically able to set it. I had done this while using ChartFX charts.
我所做的是以编程方式更改图表的底部填充,以便更改 x 轴上字符串可用的高度。
要使用
ChartText.StringFormat
属性更改图表控件的截断设置,并使用适当的枚举实例化它(您可以关闭截断)。可以添加枚举来组合效果。实例化一个新的 StringFormat 对象并从那里开始。如果您正在迭代数据(就像我一样),您可以添加一行,例如
If strXVal.Length > 15 然后 objEngine.BottomChartPadding = 150
将以编程方式为 x 轴文本提供更多空间。
What I have done is programatically change the bottom padding of the chart in order to change the height available to the strings on the x axis.
To change the truncation settings of the chart control using the
ChartText.StringFormat
property and instantiate it with the appropriate enum (you can turn truncation off). The Enums can be added to combine effects. instantiate a newStringFormat
object and go from there.If you are iterating over your data (like I am) you can add a line like
If strXVal.Length > 15 Then objEngine.BottomChartPadding = 150
that will programatically provide more room for your x-axis text.