MS Chart控件缩放MinSize问题
我正在使用 MS Chart Control .NET 3.5、WinForms、C# 实现散点图。我的 x 轴数据是 DateTime,注意到我无法放大到小于 1 天的分辨率,尽管按如下方式设置 ScaleView:
chart1.ChartAreas["MyChart"].AxisX.ScaleView.MinSize = 4;
chart1.ChartAreas["MyChart"].AxisX.ScaleView.MinSizeType = DateTimeIntervalType.Hours;
还有其他人遇到此问题吗?有什么想法吗?
I'm implementing a scatter plot using the MS Chart Control .NET 3.5, WinForms, C#. My x-axis data is DateTime and noticed I couldn't zoom in smaller than a resolution of 1 day, despite setting the ScaleView as follows:
chart1.ChartAreas["MyChart"].AxisX.ScaleView.MinSize = 4;
chart1.ChartAreas["MyChart"].AxisX.ScaleView.MinSizeType = DateTimeIntervalType.Hours;
Has anyone else had this issue? Any ideas?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
想通了……也许我对 RTFM 的了解不够接近,但从交互式演示中并不明显。
设置
然后它就可以让我沿着 x 轴缩放了。
Figured this out... perhaps I didn't RTFM close enough, but it wasn't obvious from the interactive demo.
Set
and then it allowed me to zoom along the x-axis just fine.
效果很好!
如果您想要平滑的缩放行为,则非常方便且强制。
虽然我使用了 RTFM,但并不是偶然发现的:-)
但是,如果您处理双精度或浮点数而不是基于整数的类型(例如小时或天),则将间隔设置为零可能有点极端:在缩放时,您最终会得到过于精确的标签,例如 2,907343253253235
一个很好的组合是使用这两个属性:
这样您可以根据需要缩放,同时仍然将精度控制在合理的水平
Works Great !
Very handy and mandatory if you want to have smooth Zooming behavior.
Didn't stumble upon it, though I did RTFM :-)
However, if you handle doubles or floats instead of integer based types (such as hours or days), setting the interval to Zero may be a little bit extreme : While zooming, you will end up having overly precise labels such as 2,907343253253235
A good combination is to use these two properties :
this way you can zoom as much as you want, while still controlling precision at a reasonable level