SharpPlot Tutorials > Style Examples > Spanned Labels

Spanned Labels

Column headers on table charts are spanned across empty or identical cells. Where a column is spanned, the vertical grid is omitted from between the merged cells. Multi-line X-axis labels are spanned across several tickmarks to show hierarchical time periods (e.g. months, quarters, years)


sp.TableStyle = TableStyles.Spanned;
sp.XAxisStyle = XAxisStyles.SpannedLabels;

Titles will span across as many empty cells as are available. This style also applies to the horizontal axis labels.


sp.SetXLabels(col_Subsect);
sp.BarChartStyle = BarChartStyles.ForceZero|BarChartStyles.TicksBetween;
sp.SetAxisStyle(Color.Black,LineStyle.Solid,1);
sp.XAxisStyle = XAxisStyles.MiddleLabels|XAxisStyles.SpannedLabels;
sp.SetXTickLengths(new int[] {100,0,180,0,0,180});
sp.XDatumThreshold = 200;
sp.LabelLineSpacing = 1.4;

Note the use of simple HTML tags to format the lower row of labels in bold text.

See also ...

SharpPlot Members | SharpPlot.ScatterPlotStyle Property | SharpPlot.TableStyle Property


Send comments on this topic
© Dyalog Ltd 2021