public static YAxisLabel NewAxisLabel(string label, double yoffsetPct, int xoffsetPixels, LabelPreferences ylp)
        {
            YAxisLabel yal = new YAxisLabel()
            {
                Text          = label,
                Foreground    = ylp.Foreground,
                Background    = ylp.Background,
                FontFamily    = ylp.Font,
                FontSize      = ylp.Fontsize,
                FontStyle     = ylp.Style,
                FontWeight    = ylp.Weight,
                YOffsetPct    = yoffsetPct,
                XOffsetPixels = xoffsetPixels
            };
            ScaleTransform st = new ScaleTransform(1, -1, 0.5, 0.5);
            TransformGroup tg = new TransformGroup();

            tg.Children.Add(st);
            if (ylp.Orientation == LabelOrientations.VerticalBottomToTop)
            {
                yal.RenderTransformOrigin = new System.Windows.Point(1, 1);
                tg.Children.Add(new RotateTransform(90));
            }
            if (ylp.Orientation == LabelOrientations.VerticalTopToBottom)
            {
                tg.Children.Add(new RotateTransform(-90));
            }
            yal.RenderTransform = tg;

            return(yal);
        }
        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);
        }