Home > Sample Charts > TowerChart > Using Towers to Summarise Data

Using Towers to Summarise Data

Towercharts are simply grouped barcharts with the bars drawn ‘behind’ each other rather than in groups along the X-axis. They are best used where the visual effect is more important than the readability of the data values, as it is almost impossible to read the ‘height’ values reliably, and it is very likely that in a crowded chart some towers will be completely obscured.

This example displays a one-way summary in a style very like the Excel Column chart. The perspective drawing has been turned off here to give the effect of an isometric projection.

Note that the X-axis labels have been explicitly set here – for text categories they would be automatically created as the distinct elements in the group.


SharpPlot sp = new SharpPlot;

housetype = new int[] {1,2,2,3,3,2,1,1,2,4,4,1,2,2,3,2,1,1,2,3,1,1,4,3,1,2,2,2,4};
price = new int[] {60500,47500,46000,110000,148000,65000,79950,54000,120000,85000,
         65000,55000,70000,82500,78500,49950,46950,46950,77000,102000,37500,68000,
         65000,145000,98000,75000,96500,53950,75000};

sp.Heading = "Maximum Price by House Type";

sp.GroupBy(housetype,GroupByFunction.Maximum);
sp.SetXLabels(new string[]{"Terrace","Semi","Detached","Bungalow"});

// Force isometric and horizontal X-Axis
sp.SetViewpoint(8,0,80);
sp.Perspective = 0;

sp.TowerChartStyle = TowerChartStyles.WallShading|TowerChartStyles.GridLines;

sp.ZFactor = 1000;
sp.ZCaption = "£Thousand";
sp.ZAxisStyle = ZAxisStyles.AtEndCaption;
sp.DrawTowerChart(price);

Worked Examples

towerchart1 towerchart2 towerchart3 towerchart4

Send comments on this topic
© Dyalog Ltd 2013