Home > Sample Charts > StepChart

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.

Note that you often give on more X-value that Y-value here as the X-values give the start-point for each step and there is usually an extra point at the right-hand end to determine how far to draw the final horizontal segment.


SharpPlot sp = new SharpPlot;
sp.SetMargins(12,12,18,4);
sp.SetPenWidths(3);
sp.SetColors(Color.OrangeRed);
ydata = new int[] {190,270,310,120,190,230};
xdata = new int[] {17,31,49,54,66,84,100};
sp.DrawStepChart(ydata,xdata);

Worked Examples

stepchart1 stepchart2 stepchart3 stepchart4

Send comments on this topic
© Dyalog Ltd 2013