| |||||
Introducing SharpPlot Your First Chart Recent Updates Tutorials General Tutorials Chart Tutorials Reference SharpPlot Class Properties Methods Structures Enumerations Style examples Glossaries Active Charts VectorMath Class DBUtil Class Get SharpPlot Download SharpPlot Buying SharpPlot SharpPlot Support Upgrading from GraPL Release notes |
Home > Sample Charts > StepChart StepChartStepcharts 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 |