public static void SetLegendPlacement(this PlotModel plot, LegendPlacement placement) { foreach (LegendBase legend in plot.Legends) { legend.LegendPlacement = placement; } }
public void CombinatorDoesNotOverrideSetProperties() { LegendConfigurator a = new(); LegendConfigurator b = new(); const LegendPlacement placement = LegendPlacement.Inside; const LegendPlacement ignoredPlacement = LegendPlacement.Inside; b.Placement.Set(placement); a.Placement.Set(ignoredPlacement); Combinator <LegendConfigurator> combinator = new(a, b); LegendConfigurator combined = combinator.Combine(); Assert.True(combined.Placement.IsSet); Assert.Equal(placement, combined.Placement.Value); }
public static PlotModel getPlotModel( String title, TitleHorizontalAlignment titleHorizontalAlignment, String legendTitle, LegendOrientation legendOrientation, LegendPlacement legendPlacement, LegendPosition legendPosition) { return(new PlotModel { Title = title, TitleHorizontalAlignment = titleHorizontalAlignment, LegendTitle = legendTitle, LegendOrientation = legendOrientation, LegendPlacement = legendPlacement, LegendPosition = legendPosition }); }
public void CombinatorAddsDeclaredProperties() { LegendConfigurator a = new(); LegendConfigurator b = new(); const LegendPlacement placement = LegendPlacement.Inside; const LegendPosition position = LegendPosition.LeftTop; b.Placement.Set(placement); a.Position.Set(position); Combinator <LegendConfigurator> combinator = new(a, b); LegendConfigurator combined = combinator.Combine(); Assert.True(combined.Placement.IsSet); Assert.True(combined.Position.IsSet); Assert.Equal(placement, combined.Placement.Value); Assert.Equal(position, combined.Position.Value); }
/// <summary> /// Sets the legend placement. /// </summary> /// <param name="legend">The legend to configure.</param> /// <param name="placement">The placement.</param> public static LegendConfigurator SetPlacement(this LegendConfigurator legend, LegendPlacement placement) => legend.Set(l => l.Placement, placement);