0

我正在 VisualStudio WebForm C# 中开发图表。在图例部分,它不能将指标/图像/形状更改为破折号。(用excel可以轻松完成。有什么方法吗?

我想要的是: - - - - 收入平均值(想象是虚线图像)------- 收入(想象是实线)

我能做的最接近的是:

LegendItem item1 = new LegendItem();
item1.Color = Color.Black;
item1.Name = "Income Average";
item1.BackHatchStyle = ChartHatchStyle.DarkVertical;

// Adding it into chart legend
chart1.Legends[0].CustomItems.Add(item1);  

需要建议谢谢。

4

1 回答 1

0

您可以使用它item1.ImageStyle = LegendImageStyle.Line来创建一条实线。
更多信息在这里

然而,据我所知,没有“破折号”样式,但可以使用图像作为符号。因此,您可以尝试制作虚线的小图像并阅读此内容

我希望它有所帮助。

于 2013-12-16T15:29:45.350 回答