SharpPlot Reference > SharpPlot Methods > DrawXBarChart Method

SharpPlot.DrawXBarChart Method

Create Barchart (vertical only) with given rather than logical X-axis.


sp = new SharpPlot(180,120);
sp.XAxisStyle = XAxisStyles.ForceZero;
data = new int[] {18,27,31,12,19,23};
xdata = new int[] {4,7,8,13,14,17};

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



Conventional barcharts have a purely notional X-axis – the bars are equally spaced and the bar widths are calculated from the required inter-bar spacing. In the XBar chart, you have full control over the placement of the bars and the widths – this chart would typically be used to show time on the X-axis and occasional major events (say hurricanes or earthquakes) using the bars to indicat the severity.

The widths of the bars may also be individually controlled, so it is possible to indicate more than one feature of the event using both the height and width of the bar.

See also ...

X Bar charts for positioned bars | SharpPlot Members | SharpPlot.XBarChartStyle Property | SharpPlot.SetBarWidths Method

Send comments on this topic
© Dyalog Ltd 2016