点标签位置(MS图表c#)

时间:2016-11-15 13:48:33

标签: c# charts position label

我想让我的系列点标签显示在图表之外,在该系列的按钮手中(见下图)

enter image description here

现在标签显示在中间:

enter image description here

该系列是一个RangeBar Pointwidth = 5,我设置了以下的SmartlabelStyle:

var series2 = new Series
            {
                Name = "S2",
                Color = Color.LightGray,
                ChartType = SeriesChartType.RangeBar,
                ChartArea = "boo",
                YValueType = ChartValueType.Auto,
                XValueType = ChartValueType.Auto,
                SmartLabelStyle = new SmartLabelStyle 
                 {
                   AllowOutsidePlotArea = LabelOutsidePlotAreaStyle.Yes,   
                   IsMarkerOverlappingAllowed = false, 
                   MovingDirection = LabelAlignmentStyles.Bottom
                 }
             };

我只是添加一个数据点:

minDate = new DateTime(2016, 01, 01, 00, 00, 00, 000);

// Dummy data
var values2 = new DateTime[6];
values2[0] = minDate.AddMonths(1);
values2[1] = minDate.AddMonths(2);

// Add point.
pointIndex = series2.Points.AddXY(values2[1], values2[2]);

series2.Points[pointIndex].AxisLabel = "Laa";
series2.Points[pointIndex].Label = "Laa";

如何在底部中设置点标签

0 个答案:

没有答案