MS图表:轴比例视图具有额外的边距 [英] MS Chart: Axis scale view has extra margin

查看:133
本文介绍了MS图表:轴比例视图具有额外的边距的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用适用于.Net 3.5的MS Chart控件,并尝试使用其自动轴视图选择功能:

I''m using the MS Chart controls for .Net 3.5, and trying to use its automatic axis view selection feature:

mainChartArea.CursorX.IsUserSelectionEnabled = mainChartArea.CursorY.IsUserSelectionEnabled = true;



这样做可以,但是在X轴上,可见范围的两侧都有超出实际选择的余量,通常为1个单位(因此,如果我选择1.6到3.2,它将显示0.6到4.2).似乎在Axis类中有一个私有的"marginView",它是在内部设置的,导致这种情况的发生,我看不到有将其关闭的方法.

Y轴的边距为零,并且视图选择效果很好.

所以我的问题是:还有其他人遇到过这个问题,您做了什么来解决或解决它?



This works okay, but on the X axis, the visible range has an extra margin on both sides beyond what was actually selected, typically of 1 unit (so if I select 1.6 to 3.2, it will show 0.6 to 4.2). It appears there is a private ''marginView'' in the Axis class which gets set internally that causes this to happen, and I don''t see a way of turning that off.

The Y axis has a margin of zero and the view selection works perfectly.

So my question is: has anyone else had this problem, and what did you do to fix or work around it?

推荐答案

这应该可以解决问题.

.AxisX.IsMarginVisible = False
This should fix the problem.

.AxisX.IsMarginVisible = False


这篇关于MS图表:轴比例视图具有额外的边距的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆