简体   繁体   English

MSChart X和Y轴标签在原点重叠

[英]MSChart X and Y Axis Labels Overlap at origin

Using C# and the Control MSChart. 使用C#和Control MSChart。

When I set the Min , Max and Interval properties of the X and Y axis everything comes out as it should save that the labels nearest the origin overlap. 当我设置X和Y轴的MinMaxInterval属性时,一切都会出现,因为它应该保存最接近原点的标签重叠。 If I set the IsMarginVisible to true but still calculate the interval myself the problem disappears as the X axis labels are now placed low enough that they do not impede those of the Y axis. 如果我将IsMarginVisible设置为true,但仍然自己计算间隔,则问题会消失,因为X轴标签现在放置得足够低,以至于它们不会阻碍Y轴的标签。 What property controls this offset? 哪个属性控制此偏移量?

I have a similar problem if I show Axis Arrows: the arrowhead and one of the labels overlap. 如果显示“轴箭头”,也会遇到类似的问题:箭头和标签之一重叠。

You should enable smart labels. 您应该启用智能标签。 When smart labels are enabled, the Chart control first attempts to reposition an overlapping data point label near the data point itself. 启用智能标签后,“图表”控件首先尝试在数据点本身附近重新放置重叠的数据点标签。 If it fails, the Chart control then moves the data point label to a valid free space and draws a line to link the label with the data point. 如果失败,则Chart控件然后将数据点标签移至有效的可用空间,并绘制一条线以将标签与数据点链接。

   chart1.Series["Default"].SmartLabelStyle.Enabled = true;

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM