gpt4 book ai didi

mschart - 微软图表控件: Prevent Series from appearing in Legend

转载 作者:行者123 更新时间:2023-12-02 09:59:29 25 4
gpt4 key购买 nike

在 MS Chart 控件(他们从 Dundas 购买)中,我需要绘制三个系列。

该系列中的两个应该在传奇中包含条目,但第三个不应该。

我已经尝试过这些代码行,但没有任何效果:

Chart c = new Chart();
ChartArea ca = c.ChartAreas.Add("main");
Legend lg = c.Legends.Add("mainLegend");
Series s1 = c.Series.Add("s1");
Series s2 = c.Series.Add("s2");
Series s3 = c.Series.Add("s3");

// ... populate the 3 series with data...

s1.Legend = "mainLegend";
s2.Legend = "mainLegend";

// I've tried these:
s3.Legend = ""; // gives an error about a nonexistent legend named ''
s3.LegendText = ""; // just shows "s3" in the legend

如何防止该系列出现在图例中?

最佳答案

用途:

s3.IsVisibleInLegend = false;

免责声明:仅在 (ASP).Net 4、VS 2010 中进行测试。您的情况可能会有所不同...

关于mschart - 微软图表控件: Prevent Series from appearing in Legend,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1917707/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com