简体   繁体   English

如何更改正在显示该系列的图例对象?

[英]How do I change which Legend object is displaying this series?

Data.Visualization.Charting 数据可视化图表

I have a chart control with 2 ChartAreas. 我有一个带有2个ChartAreas的图表控件。 But all the Legend names are being shown in a single Legend object. 但是所有图例名称都显示在单个图例对象中。

I know how to create a second Legend object, BUT how do I associate a series with this second Legend object so that I see Legend entry ONLY in second Legend object? 我知道如何创建第二个图例对象,但是如何将序列与此第二个图例对象相关联,以便仅在第二个图例对象中看到图例条目?

You can assign which Legend contains a Series simply be setting the Series ' Legend property: 您可以将其Legend包含Series仅仅是设置SeriesLegend特性:

Legend L2 = chart1.Legends.Add("L2"); 
someSeries.Legend = "L2";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM