Ejemplo n.º 1
0
 public static void SetLegendPlacement(this PlotModel plot, LegendPlacement placement)
 {
     foreach (LegendBase legend in plot.Legends)
     {
         legend.LegendPlacement = placement;
     }
 }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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
     });
 }
Ejemplo n.º 4
0
        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);
        }
Ejemplo n.º 5
0
 /// <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);