public PlotPropertiesViewModel() { LegendPositions.Add(LegendPosition.BottomLeft.ToString()); LegendPositions.Add(LegendPosition.BottomRight.ToString()); LegendPositions.Add(LegendPosition.TopLeft.ToString()); LegendPositions.Add(LegendPosition.TopRight.ToString()); SelectedLegendPosition = LegendPosition.TopRight.ToString(); LegendPlacements.Add(LegendPlacement.Inside.ToString()); LegendPlacements.Add(LegendPlacement.Outside.ToString()); SelectedLegendPlacement = LegendPlacement.Inside.ToString(); LegendOrientations.Add(LegendOrientation.Horizontal.ToString()); LegendOrientations.Add(LegendOrientation.Vertical.ToString()); SelectedLegendOrientation = LegendOrientation.Vertical.ToString(); Fonts.Add("Arial"); Fonts.Add("Segoe UI"); Fonts.Add("Times New Roman"); Fonts.Add("Verdana"); SelectedFont = "Segoe UI"; }
private LegendOptions.LegendPositions getLegendPositionFor(LegendPositions legendPosition) { switch (legendPosition) { case LegendPositions.None: return(LegendOptions.LegendPositions.OuterNorthEast); case LegendPositions.Right: return(LegendOptions.LegendPositions.OuterNorthEast); case LegendPositions.RightInside: return(LegendOptions.LegendPositions.NorthEast); case LegendPositions.Bottom: return(LegendOptions.LegendPositions.OuterSouthEast); case LegendPositions.BottomInside: return(LegendOptions.LegendPositions.SouthEast); default: throw new ArgumentOutOfRangeException("legendPosition"); } }
private LegendOptions.LegendPositions getLegendPosition(LegendPositions legendPosition) { switch (legendPosition) { case LegendPositions.None: return(LegendOptions.LegendPositions.OuterSouth); case LegendPositions.Bottom: return(LegendOptions.LegendPositions.OuterSouthEast); case LegendPositions.BottomInside: return(LegendOptions.LegendPositions.SouthEast); case LegendPositions.Right: return(LegendOptions.LegendPositions.OuterNorthEast); case LegendPositions.RightInside: return(LegendOptions.LegendPositions.NorthEast); default: return(LegendOptions.LegendPositions.NorthEast); } }
public static void LegendPosition(this Legend legend, LegendPositions legendPosition) { switch (legendPosition) { case LegendPositions.None: legend.Visibility = DefaultBoolean.False; break; case LegendPositions.Right: legend.Visibility = DefaultBoolean.True; legend.AlignmentHorizontal = LegendAlignmentHorizontal.RightOutside; legend.AlignmentVertical = LegendAlignmentVertical.Top; break; case LegendPositions.Bottom: legend.Visibility = DefaultBoolean.True; legend.AlignmentHorizontal = LegendAlignmentHorizontal.Right; legend.AlignmentVertical = LegendAlignmentVertical.BottomOutside; break; case LegendPositions.RightInside: legend.Visibility = DefaultBoolean.True; legend.AlignmentHorizontal = LegendAlignmentHorizontal.Right; legend.AlignmentVertical = LegendAlignmentVertical.Top; break; case LegendPositions.BottomInside: legend.Visibility = DefaultBoolean.True; legend.AlignmentHorizontal = LegendAlignmentHorizontal.Right; legend.AlignmentVertical = LegendAlignmentVertical.Bottom; break; default: throw new ArgumentException("LegendPosition " + legendPosition + " not implemented."); } }