OxyPlot图例管理项目

Sha*_*334 1 wpf oxyplot

有没有办法管理传奇中的项目?我的意思是eq从传奇中删除一些项目,但不是从整个情节中删除?我知道情节中的每个系列都与图例中的一个项目相关联,但我想打破这个规则,并将传说中只选择系列.

谢谢你的要求.

Jos*_*ose 11

如果您没有为系列(lineseries等)指定标题,则不会在图例上显示:

plotModel = new PlotModel();
plotModel.LegendTitle = "Legend";
plotModel.LegendPosition = LegendPosition.RightBottom;

plotModel.Series.Add(new LineSeries
{
    ItemsSource = someItemSource,
    Color = OxyColors.Red,
    //Title = "title" <- Title commented
});
Run Code Online (Sandbox Code Playgroud)

  • “Series”还有一个名为“RenderInLegend”的“bool”,您可以使用它来隐藏图例中的系列。 (2认同)