step graph

453 views
Skip to first unread message

Dan Keshet

unread,
Oct 15, 2009, 1:22:55 PM10/15/09
to jqplot...@googlegroups.com
Hi,

Are there any renderers / settings for renderers for creating a step graph?   That is, a graph where the lines drawn are all horizontal, extending from each data point until it reaches the x-position of the next datapoint, rather than sloped to connect each adjacent data point?

Thanks for your wonderful project,

Dan Keshet

Chris Leonello

unread,
Oct 21, 2009, 10:35:19 PM10/21/09
to jqplot...@googlegroups.com
That's a great idea!  I don't have anything like that implemented yet.

--
Chris Leonello



bombe...@gmail.com

unread,
May 21, 2013, 1:03:32 PM5/21/13
to jqplot...@googlegroups.com
Has this been implemented?

It would be nice to have the possibility of turning off interpolation.

c0mputer

unread,
Jun 5, 2013, 2:28:27 PM6/5/13
to jqplot...@googlegroups.com
Seconding this. When graphing boolean values, it's painful to watch an interpolated line being drawn.

Johann Van Deventer

unread,
Jun 6, 2013, 2:16:58 AM6/6/13
to jqplot...@googlegroups.com, dk...@qcue.net
Hi

I'm also looking for this and would like to know if it has been implemented. 
An additional option on this would be to be able to choose the direction. What I mean by this is, if the value plotted on a specific point is carried forward to the next point or if it is carried backwards to the previous point

Regards,
Johann

Florin Cretu

unread,
Sep 1, 2013, 3:00:52 AM9/1/13
to jqplot...@googlegroups.com, dk...@qcue.net
very good option to have

Marcus Garcia

unread,
Nov 27, 2013, 11:59:24 AM11/27/13
to jqplot...@googlegroups.com, dk...@qcue.net
In my case, I'm doing a plotter with the jqPlot API, and my chart has an horizontal axes with TimeStamps and the Vertical is with Number values.

So what I did was repeat the actual value at the last timestamp position:

if(subscribedPens[index].interpolated == false) {
var aux = dataPlot[index][dataPlot[index].length-1][0] + 1;
dataPlot[index].push([aux, tagValue]);
}
dataPlot[index].push(array);

hope it helps.

Brian Janes

unread,
Dec 20, 2013, 3:39:59 PM12/20/13
to jqplot...@googlegroups.com, dk...@qcue.net
I also needed this, so I added it.  It was easy once I figured out where to do it.  Using 1.0.8, at the following approximate line numbers in the main JS file:

1309        this._type = '';        
1310        this.step = false;
1311    }

and

5628            if (data[i][0] != null && data[i][1] != null) {
5629                if (this.step && i>0) {
5630                    gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i-1][1])]);
5631                }
5632                gd.push([xp.call(this._xaxis, data[i][0]), yp.call(this._yaxis, data[i][1])]);
5633            }

It works by just adding the previous yaxis value to the current xaxis location, resulting in two yaxis values for that location.  The result is shown in the blue "average" series line below:

Hope this helps!

Reply all
Reply to author
Forward
0 new messages