本文为你讲解如何用VS下的.NET图表控件Chart FX 7创建多行标签。通常,添加多行标签可以在标签文本上添加换行符 ("\n"),但这样你必须为step属性指定一个值,而Chart FX 7图表则会自动选择一个step,而无需再添加换行符。
Chart FX 7创建多行标签源代码:
Chart1.Data.Series = 2;
Chart1.Data.Points = 3;
Chart1.AxisX.Labels[0] = "line one\n line two\n line three\n line four";
Chart1.AxisX.Labels[1] = "line one\n line two\n line three\n line four";
Chart1.AxisX.Labels[2] = "line one\n line two\n line three\n line four";
Chart1.PlotAreaMargin.Bottom = 300;
Chart1.AxisX.Step = 1;
Chart1.AxisX.Style = Chart1.AxisX.Style | AxisStyles.NotClipped;
效果图:
来源:oschina
链接:https://my.oschina.net/u/1254919/blog/157925