TableChart
General
More detailed information can be found here: https://developers.google.com/chart/interactive/docs/gallery/table
Example
// Create model
final ChartModel model = ChartModel.New()
.addColumn(Column.New(Type.STRING, "Name"))
.addColumn(Column.New(Type.NUMBER, "Salary"))
.addColumn(Column.New(Type.BOOLEAN, "Full Time Employee"));
// Add items to model
model.addRow("Mike", Cell.New(10000, "$10.000"), true);
model.addRow("Jim", Cell.New(8000, "$8.000"), false);
model.addRow("Alice", Cell.New(12500, "$12.500"), true);
model.addRow("Bob", Cell.New(7000, "$7.000"), true);
// Set model
tableChart.setModel(model);
API and methods
Properties | |
---|---|
AllowHTML |
If this option is set to true, formatted values of cells containing HTML tags are rendered as HTML. With false most of the custom formatters is not correct.
|
AlternatingRowStyle |
Specifies whether to assign an alternating color style to odd and even rows.
|
FirstRowNumber |
The row number for the first row in the dataTable. Used only if showRowNumber is true.
|
FrozenColumns |
The number of columns from the left that should be frozen. These columns will stay in place when the rest of the columns are scrolled horizontally. If
|
Page |
Whether and how to enable scrolling through the data. Select one of the following string values:
|
PageSize |
The number of lines on each page when paging is enabled with the page option.
|
PagingButtons |
Sets a specific option for the scroll buttons. The options are as follows:
|
RtlTable |
Adds basic support for right-to-left languages (such as Arabic or Hebrew) by reversing the column order of the table so that column zero is the rightmost column and the last column is the leftmost column. This does not affect the column index in the underlying data, only the display order. Full bidirectional (BiDi) language display is not supported by Table Visualization even with this option. This option is ignored if you enable paging (with the page option) or if the table has scroll bars because you specified height and width options smaller than the required table size.
|
ScrollLeftStartPosition |
Sets the horizontal scroll position in pixels if the table has horizontal scrollbars because you have set the width property. The table is scrolled that many pixels beyond the leftmost column.
|
ShowRowNumber |
If set to true, the row number will be displayed as the first column of the table.
|
Sort |
Whether and how the columns should be sorted when the user clicks on a column heading. If sorting is enabled, you should also set the sortAscending and sortColumn properties. Choose one of the following string values:
|
StartPage |
The first table page to be displayed. Used only when
|