Microsoft Chart Control:防止系列出现在图例中
在 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
How do I Prevent the series from shown in the legend?
In the MS Chart control (which they bought from Dundas), I have three series that need to be plotted.
Two of the series should have an entry in the Legend, but the third should not.
I've tried these lines of code, but none work:
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
How do I prevent the series from appearing in the legend?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用:
免责声明:仅在 (ASP).Net 4、VS 2010 中进行测试。您的情况可能会有所不同...
Use:
Disclaimer: Only tested in (ASP).Net 4, VS 2010. Your mileage may vary...