Difference between revisions of "Tabulation setTableDiagramStyle"
Line 42: | Line 42: | ||
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_VALIGN<br/> | | colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_VALIGN<br/> | ||
| style="border: 1px solid #010101" width="174" | string<br/> | | style="border: 1px solid #010101" width="174" | string<br/> | ||
− | | takes string values of these Center, | + | | takes string values of these Center, Top, Bottom<br/> |
|- | |- | ||
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_HALIGN<br/> | | colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_HALIGN<br/> | ||
Line 70: | Line 70: | ||
===Examples=== | ===Examples=== | ||
+ | Before set Table diagram style | ||
[[File:Tabulation setTableDiagramStyle1.png|none]] | [[File:Tabulation setTableDiagramStyle1.png|none]] | ||
+ | |||
+ | |||
<source lang="javascript"> | <source lang="javascript"> | ||
DCS_use(15507609); | DCS_use(15507609); | ||
Tabulation_setTableLayout(TableChartLayout_Classic); | Tabulation_setTableLayout(TableChartLayout_Classic); | ||
− | array FoS_default = DiagramFontStyle_getDefault(); | + | array FoS_default = DiagramFontStyle_getDefault(); //Gets a default chart font style object |
+ | //Custom chart font style | ||
FoS_default[DIAGRAM_FONT_STYLE_COLOR] = Color_getByRGB("#000000"); | FoS_default[DIAGRAM_FONT_STYLE_COLOR] = Color_getByRGB("#000000"); | ||
FoS_default[DIAGRAM_FONT_STYLE_FACE] = "Arial"; | FoS_default[DIAGRAM_FONT_STYLE_FACE] = "Arial"; | ||
FoS_default[DIAGRAM_FONT_STYLE_SIZE] = 10 ; | FoS_default[DIAGRAM_FONT_STYLE_SIZE] = 10 ; | ||
− | array FiS_default = DiagramFillStyle_getDefault(); | + | array FiS_default = DiagramFillStyle_getDefault(); //Gets a default chart fill style object |
+ | //Custom chart fill style | ||
FiS_default[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#f3f4f5"); | FiS_default[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#f3f4f5"); | ||
− | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_FONT, FoS_default); | + | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_FONT, FoS_default); //Set custom chart font style |
− | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_FILL, FiS_default); | + | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_FILL, FiS_default); //Set custom chart fill style |
− | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_VALIGN, "center"); | + | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_VALIGN, "center"); //Vertical align the content inside |
− | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_HALIGN, "right"); | + | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_HALIGN, "right"); //Horizontal align the content inside |
− | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_NUMBER_FORMATTER, "{0:#;minus #;zero}"); | + | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_NUMBER_FORMATTER, "{0:#;minus #;zero}"); //Set number style format |
− | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_PERCENT_FORMATTER, "{0:#;minus #;zero}pct"); | + | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_PERCENT_FORMATTER, "{0:#;minus #;zero}pct"); //Set percent style format |
− | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_SIGNIFICANCE_FORMATTER, "{1}{0:+;-;,}"); | + | Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_SIGNIFICANCE_FORMATTER, "{1}{0:+;-;,}"); //Set significance style format |
createCrossDiagram({"QA1"},{"D_Age_Group"}); | createCrossDiagram({"QA1"},{"D_Age_Group"}); | ||
</source> | </source> | ||
+ | |||
+ | After set Table diagram style | ||
[[File:Tabulation setTableDiagramStyle2.png|none]] | [[File:Tabulation setTableDiagramStyle2.png|none]] | ||
__NOTOC__ | __NOTOC__ |
Revision as of 11:11, 7 December 2015
===Tabulation_setTableDiagramStyle===)
Sets the style for part of a chart.
Syntax
Tabulation_setTableDiagramStyle(styleType, tableDiagramStyle, argTableDiagramStyle);
Arguments
- styleType: is the CELL type that will be affected by the call. It's the value of the Table diagram constants. Or we can also use the name of Table Diagram constants
- tableDiagramStyle: is the kind of style. It's the value of the Table Diagram style constants. Or we can also use the name of Table Diagram style constants
- argTableDiagramStyle: is argument for the given tableDiagramStyle
tableDiagramStyle |
Type |
Description |
TABLE_DIAGRAM_STYLE_FILL |
array |
Is the array of function DiagramFillStyle_getDefault |
TABLE_DIAGRAM_STYLE_DECIMAL |
number |
With min 0 |
TABLE_DIAGRAM_STYLE_FONT |
array |
Is the array of function DiagramFontStyle_getDefault |
TABLE_DIAGRAM_STYLE_VALIGN |
string |
takes string values of these Center, Top, Bottom |
TABLE_DIAGRAM_STYLE_HALIGN |
string |
takes string values of these Center, Left, Right |
TABLE_DIAGRAM_STYLE_NUMBER_FORMATTER |
string |
takes a string.format string, default is "{0:"+decimalplaces+"}" |
TABLE_DIAGRAM_STYLE_PERCENT_FORMATTER |
string |
takes a string.format string, default is "{0:"+decimalplaces+"}%" |
TABLE_DIAGRAM_STYLE_SIGNIFICANCE_FORMATTER |
string |
takes a string.format string, default is "{0:[+];[-];,} {1}" where 0 is int that is positive, negative or zero depending on significance and 1 is the Z value |
TABLE_DIAGRAM_STYLE_BORDER_STYLE |
object |
takes a Border object |
Return type
Empty
Examples
Before set Table diagram style
DCS_use(15507609);
Tabulation_setTableLayout(TableChartLayout_Classic);
array FoS_default = DiagramFontStyle_getDefault(); //Gets a default chart font style object
//Custom chart font style
FoS_default[DIAGRAM_FONT_STYLE_COLOR] = Color_getByRGB("#000000");
FoS_default[DIAGRAM_FONT_STYLE_FACE] = "Arial";
FoS_default[DIAGRAM_FONT_STYLE_SIZE] = 10 ;
array FiS_default = DiagramFillStyle_getDefault(); //Gets a default chart fill style object
//Custom chart fill style
FiS_default[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#f3f4f5");
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_FONT, FoS_default); //Set custom chart font style
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_FILL, FiS_default); //Set custom chart fill style
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_VALIGN, "center"); //Vertical align the content inside
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_HALIGN, "right"); //Horizontal align the content inside
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_NUMBER_FORMATTER, "{0:#;minus #;zero}"); //Set number style format
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_PERCENT_FORMATTER, "{0:#;minus #;zero}pct"); //Set percent style format
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_SIGNIFICANCE_FORMATTER, "{1}{0:+;-;,}"); //Set significance style format
createCrossDiagram({"QA1"},{"D_Age_Group"});
After set Table diagram style