简体   繁体   中英

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

Data.Visualization.Charting

I have a chart control with 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 L2 = chart1.Legends.Add("L2"); 
someSeries.Legend = "L2";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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