SharpPlot Reference > SharpPlot Methods > DrawStepChart Method

SharpPlot.DrawStepChart Method

Construct step chart from data and step start-points.


sp = new SharpPlot(180,120);
ydata = new int[] {190,270,310,120,190,230};
xdata = new int[] {17,31,49,54,66,84,100};

The short tutorial shows a few of the possibilities and some sample code.



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.

See also ...

Step charts for discontinuous data | SharpPlot Members | SharpPlot.StepChartStyle Property

Send comments on this topic
© Dyalog Ltd 2021