예제 #1
0
        protected void AddLabel(GraphSurface surface, T datum, ScaledValue midLine)
        {
            var text = label(datum)?.ToString();

            if (!string.IsNullOrWhiteSpace(text))
            {
                surface.XAxis.Gutter.Add(new GutterText(midLine.FinalFraction(surface.XAxis),
                                                        text, angle(datum), size(datum), int.MaxValue - 1));
            }
        }
예제 #2
0
        public override void Render(GraphSurface surface)
        {
            var pos = 0.1;

            surface.XAxis.ScaledValue(0.0); // set the margins right
            foreach (var datum in innerData)
            {
                var midline = new ScaledValue(pos + 0.4);
                AddLabel(surface, datum.c50.Item, midline);
                datum.DrawBox(surface, new ScaledValue(pos), midline, new ScaledValue(0.8 + pos), Pen, Brush, BackgroundBrush);

                pos += 1;
            }
            surface.XAxis.ScaledValue(pos - 0.1); // set the margins right
        }
예제 #3
0
            public void DrawBox(GraphSurface surface, ScaledValue left, ScaledValue midline, ScaledValue right,
                                Func <T, Pen> pen, Func <T, Brush> brush, Func <T, Brush> backgroundBrush)
            {
                surface.Rectangle(left, c75.Position, right, c25.Position, pen(c75.Item), backgroundBrush(c50.Item));
                void InnerLine(SingleBoxValue value, Pen usePen = null) => surface.Line(left, value.Position, right, value.Position,
                                                                                        usePen ?? pen(value.Item));

                InnerLine(min);
                var lightPen = pen(c50.Item);

                InnerLine(c50, new Pen(lightPen.Brush, lightPen.Thickness * 2));
                InnerLine(max);
                surface.Line(midline, c75.Position, midline, max.Position, pen(max.Item));
                surface.Line(midline, min.Position, midline, c25.Position, pen(min.Item));
                var separator = surface.GetGlyphSeparator();

                foreach (var outlier in outliers)
                {
                    separator.DrawGlyph((outlier.Value <highOutlier && outlier.Value> lowOutlier)?null:brush(outlier.Item), pen(outlier.Item), 3, midline, outlier.Position,
                                        Glyphs.Circle);
                }
            }
예제 #4
0
 public SingleBoxValue(T item, double value)
 {
     Item     = item;
     Position = new ScaledValue(value);
 }