| |||||
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 > Table > Cross-tabulation with Two Levels Cross-tabulation with Two LevelsTables are often used very effectively in combination with other charts to add summarized information. For example a plot of a stock price might include a small table of the low and high values for the past year, and maybe a comparison with the industry sector. This example shows the same data, but split 2 ways to make a hierarchical summary. Note that a frame has already been drawn here (with the main chart heading) and the table is fitted automatically into the frame width. You can also add an extra level of Grouping to have an indented 2-level summary shown in the row-stubs. SharpPlot sp = new SharpPlot; sp.Heading = "Complete Barley Data Tabulation"; sp.SetMargins(36,0,0,0); sp.DrawFrame(); sp.SplitBy(_barleyfarm); sp.SplitBy(_barleyyear); sp.GroupBy(_barleyvariety); sp.TableStyle = TableStyles.GridLines|TableStyles.Spanned|TableStyles.FitWidth; sp.YCaption = "Yield by\nVariety"; sp.ValueTagFormat = "##0.0kg"; // Formatter sp.ValueTagStyle = ValueTagStyles.Center; sp.DrawTable(_barleydata); Worked Examples |