| |||||
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 > A Simple Data Table A Simple Data TableTables 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. SharpPlot treats each array-element in the argument as a column of data, and uses the X-labels as the column headers, with the Y-labels as the row-stubs. The Y-caption is used here to label the cell in the top-left corner. If a simple array of numbers is passed, it is treated as a one-column table. SharpPlot sp = new SharpPlot; column1 = new int[] {18,27,31,1,1}; column2 = new int[] {120,34,27,18,8}; sp.SetYLabels(new string[]{"North","South","East","West","Other"}); sp.SetXLabels(new string[]{"2004","2005"}); sp.YCaption = "Regional\nTotals"; sp.TableStyle = TableStyles.Boxed|TableStyles.GridLines|TableStyles.Shadowed; sp.SetValueFont("ARB",12); sp.ValueTagFormat = "##0.0"; sp.SetLabelFont("ARB",13); sp.SetCaptionFont("ARB",13); sp.DrawTable(new int[][]{column1,column2}); Worked Examples |