Digital graph

Nov 3, 2009 at 10:34 AM
Edited Nov 3, 2009 at 10:55 AM

Is there support for digital graphs? I did wonder if it could be implemented with a custom marker - would be grateful for any hints.

Examples to explain what I mean by 'digital graph':

Nov 3, 2009 at 11:21 AM


As I have understod from the pictures you've posted, you need some specific processing of input data for line chart. You can yourself write such a processing, and add to linechart already processed sequence of points. In the future I'll add such kind of filter to D3, if I not forget to do it)

If you mentioned something else, please correct me.




Nov 3, 2009 at 11:34 AM
Edited Nov 3, 2009 at 11:46 AM

Just to make things clear;

The source data for the first picture is: (x,y) (0,0), (1,1), (2,1), (3,0), (4,1), (5,0). There is no extra point drawn where the blue arrows are, it just only draws the lines at right-angles. With that in mind would the method still be to add an input filter to create a data list something like: (x,y) (0,0), (1,0), (1,1), (2,1), (2,0), (3,0), (3,1), (4,1), (4,0), (5,0) ?

And an explanation from the documentation for the product shown in the second picture: If the current point is represented as (x0, y0) and the next point is represented as (x1, y1), then a line from (x0, y0) to (x1, y0) and (x1, y0) to (x1, y1) represents an XY step.


Nov 3, 2009 at 11:56 AM

I think you are right, this follows from pictures you've sent.


Mar 11, 2011 at 10:11 AM
Edited Mar 11, 2011 at 12:05 PM


for others who have this problem: You could use a Filter.

   class StepLineFilter : PointsFilterBase
      double lastX;

      public override List<Point> Filter(List<Point> points)
         int pointsCount = points.Count;
         List<Point> res = new List<Point>(pointsCount * 2);
         for (int i = 0; i < pointsCount; i++)
            if (i < pointsCount - 1)
               res.Add(new Point(points[i + 1].X, points[i].Y));
               res.Add(new Point(lastX, points[i].Y));

         return res;

      public override void SetScreenRect(Rect screenRect)
         lastX = screenRect.X + screenRect.Width;
LineGraph.Filters.Add(new StepLineFilter());

Best regards, Torsten

May 8, 2012 at 6:16 PM

Hey Torsten, 

very usefull and it was exactly what I  needed!


I will just need to adapt the SetScreenRect() to stopping drawing a giant plotter in my chart ;)


Best regards, Marcus!