Home > Sample Charts > StepChart > A Simple Stepchart

A Simple Stepchart

Stepcharts are used for two main purposes – timeseries where the values change discontinuously (interest rates are typical) and summary data where the groups are of variable width (monthly totals). SharpPlot can draw the steps with risers from the X-axis (which has the effect of abutted bars) and with shading down to either the axis or a given reference line.

This chart-type is unusual in that the x-data typically has one more value than the y-data, giving the endpoint of the final plateau in the data.


SharpPlot sp = new SharpPlot;
ydata = new int[] {4,8,12,6};
steps = new int[] {1,5,7,9,14};

sp.YAxisStyle = YAxisStyles.ForceZero;
sp.Heading = "Simple Stepchart";

sp.DrawStepChart(ydata,steps);

Worked Examples

stepchart1 stepchart2 stepchart3 stepchart4

Send comments on this topic
© Dyalog Ltd 2013