public static YAxisLabel NewAxisLabel(string label, double yoffsetPct, double xoffsetPixels, Brush foreground, Brush background, FontFamily font, double fontsize, LabelOrientations orientation) { YAxisLabel yal = new YAxisLabel() { Text = label, Foreground = foreground, Background = background, FontFamily = font, FontSize = fontsize, YOffsetPct = yoffsetPct, XOffsetPixels = xoffsetPixels }; ScaleTransform st = new ScaleTransform(1, -1, 0.5, 0.5); TransformGroup tg = new TransformGroup(); tg.Children.Add(st); if (orientation == LabelOrientations.VerticalBottomToTop) { tg.Children.Add(new RotateTransform(90)); } if (orientation == LabelOrientations.VerticalTopToBottom) { tg.Children.Add(new RotateTransform(-90)); } yal.RenderTransform = tg; return(yal); }
public static LabelPreferences NewLabelPreferences(Brush foreground, Brush background, FontFamily font, double fontSize, FontStyle fontStyle, FontWeight fontWeight, LabelOrientations labelOrientation = LabelOrientations.Normal) { return(new LabelPreferences { Foreground = foreground, Background = background, Font = font, Fontsize = fontSize, Style = fontStyle, Weight = fontWeight, Orientation = labelOrientation }); }