Difference between revisions of "Tabulation setTableDiagramStyle"

From Catglobe Wiki
Jump to: navigation, search
 
(16 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== Return type<br/> ==
+
[[Category:Style_setting_functions]]
 +
{{HelpFiles}}
  
Returns the following array
+
===Tabulation_setTableDiagramStyle===
  
{| class="tableintopic" style="border-collapse: collapse;  border: 1px solid rgb(1, 1, 1)" border="1" cellpadding="2" width="958"
+
Sets the style for a chart.
|- align="left" valign="top"
+
 
| style="border: 1px solid #010101" bgcolor="#F59D56" width="227" | <p style="text-align: center">tableDiagramStyle</p>
+
===Syntax===
| style="border: 1px solid #010101" bgcolor="#F59D56" width="227" | <p style="text-align: center">Constant</p>
+
 
| style="border: 1px solid #010101" bgcolor="#F59D56" width="73" | <p style="text-align: center">Type</p>
+
Tabulation_setTableDiagramStyle(styleType, tableDiagramStyle, argTableDiagramStyle);
| style="border: 1px solid #010101" bgcolor="#F59D56" width="174" | <p style="text-align: center">Initial/Default value</p>
 
| style="border: 1px solid #010101" bgcolor="#F59D56" width="433" | <p style="text-align: center">Description</p>
 
|- align="left" valign="top"
 
| colspan="1" rowspan="3" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_FILL<br/>
 
| style="border: 1px solid #010101" width="227" |
 
DIAGRAM_FILL_STYLE_COLOR
 
  
| style="border: 1px solid #010101" width="73" |
+
can use [[TabulationDiagramParameter_class|TabulationDiagramParameter.SetTableDiagramStyle]](styleType, tableDiagramStyle, argTableDiagramStyle)
Array
 
  
| style="border: 1px solid #010101" width="174" |
+
===Arguments===
Default extracted from system's default style sheet.
 
  
| style="border: 1px solid #010101" width="433" |
+
*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 [http://wiki.catglobe.com/index.php/CGS_Constants_list#Table_Diagram_constants Table Diagram constants]
Fill style. Background color.
+
*tableDiagramStyle: is the kind of style. It's the value of the Table Diagram style constants. Or we can also use the name of [http://wiki.catglobe.com/index.php/CGS_Constants_list#Table_Diagram_style_constants Table Diagram style constants]
 +
*argTableDiagramStyle: is argument for the given tableDiagramStyle
  
|-
+
{| class="tableintopic" style="border-collapse: collapse;  border: 1px solid rgb(1, 1, 1)" border="1" cellpadding="2" width="958"
| style="border: 1px solid #010101" width="227" | DIAGRAM_FILL_STYLE_TYPE<br/>
+
|- align="left" valign="top"
| style="border: 1px solid #010101" width="73" |  
+
| style="border: 1px solid #010101" bgcolor="#F59D56" width="227" |  
Number
+
TableDiagramStyle
  
| style="border: 1px solid #010101" width="174" | Default extracted from system's default style sheet<br/>
+
| style="border: 1px solid #010101" bgcolor="#F59D56" width="73" |
| style="border: 1px solid #010101" width="433" |  
+
Argument type
Fill type. Enumeration. Either 1: Diagram_Fill_Style_NoFill or 2: Diagram_Fill_Style_Fill
 
  
|-
+
| style="border: 1px solid #010101" bgcolor="#F59D56" width="433" |  
| style="border: 1px solid #010101" width="73" | DIAGRAM_FILL_STYLE_INHERIT<br/>
+
Description
| style="border: 1px solid #010101" width="174" |  
 
Boolean
 
  
| style="border: 1px solid #010101" width="433" | False<br/>
 
| Specifies whether the font style will be inherited from the style sheet (when True) or gotten from the system's default (when False).<br/>
 
|-
 
| colspan="1" rowspan="7" style="border: 1px solid #010101" width="73" | TABLE_DIAGRAM_STYLE_FONT<br/>
 
| style="border: 1px solid #010101" width="174" | DIAGRAM_FONT_STYLE_FACE<br/>
 
| style="border: 1px solid #010101" width="433" | String<br/>
 
| style="border: 1px solid #010101" width="433" | Default extracted from system's default style sheet.<br/>
 
| Font face. Currently, the system supports the following font face: arial, courier new, lucida sans unicode, ms sans serif, tahoma, verdana, arial black, arial narrow, comic sans ms, wingdings, kantipur.<br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="174" | DIAGRAM_FONT_STYLE_SIZE<br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_FILL<br/>
| style="border: 1px solid #010101" width="433" | Number<br/>
+
| style="border: 1px solid #010101" width="73" | array<br/>
| style="border: 1px solid #010101" width="433" | Default extracted from system's default style sheet.<br/>
+
| style="border: 1px solid #010101" width="433" | Is the array of function [http://wiki.catglobe.com/index.php/DiagramFillStyle_getDefault DiagramFillStyle_getDefault]<br/>
| Font size.<br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="174" | DIAGRAM_FONT_STYLE_COLOR<br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_DECIMAL<br/>
| style="border: 1px solid #010101" width="433" | Array<br/>
+
| style="border: 1px solid #010101" width="174" | number<br/>
| style="border: 1px solid #010101" width="433" | Default extracted from system's default style sheet.<br/>
+
| With min 0<br/>
| Font color.<br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="174" | DIAGRAM_FONT_STYLE_BOLD<br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_FONT<br/>
| style="border: 1px solid #010101" width="433" | Boolean<br/>
+
| style="border: 1px solid #010101" width="174" | array<br/>
| style="border: 1px solid #010101" width="433" | Default extracted from system's default style sheet.<br/>
+
| Is the array of function [http://wiki.catglobe.com/index.php/DiagramFontStyle_getDefault DiagramFontStyle_getDefault]<br/>
| Font style: bold.<br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="174" | DIAGRAM_FONT_STYLE_ITALIC<br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_VALIGN<br/>
| style="border: 1px solid #010101" width="433" | Boolean<br/>
+
| style="border: 1px solid #010101" width="174" | string<br/>
| style="border: 1px solid #010101" width="433" | Default extracted from system's default style sheet.<br/>
+
| takes string values of these Center, Top, Bottom<br/>
| Font style: italic.<br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="174" | DIAGRAM_FONT_STYLE_UNDERLINE<br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_HALIGN<br/>
| style="border: 1px solid #010101" width="433" | Boolean<br/>
+
| style="border: 1px solid #010101" width="174" | string<br/>
| style="border: 1px solid #010101" width="433" | Default extracted from system's default style sheet.<br/>
+
| takes string values of these Center, Left, Right<br/>
| Font style: underline.<br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="174" | DIAGRAM_FONT_STYLE_INHERIT<br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_NUMBER_FORMATTER<br/>
| style="border: 1px solid #010101" width="433" | Boolean<br/>
+
| style="border: 1px solid #010101" width="174" | string<br/>
| style="border: 1px solid #010101" width="433" | False<br/>
+
| takes a string.format string, default is "{0:"+decimalplaces+"}" ex: {0:0.00}<br/>
| Specifies whether the font style will be inherited from the style sheet (when True) or gotten from the system's default (when False).<br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="73" | TABLE_DIAGRAM_STYLE_VALIGN<br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_PERCENT_FORMATTER<br/>
| style="border: 1px solid #010101" width="174" | <br/>
+
| style="border: 1px solid #010101" width="174" | string<br/>
| style="border: 1px solid #010101" width="433" | <br/>
+
| takes a string.format string, default is "{0:"+decimalplaces+"}%" ex: {0:0.00}%<br/>
| style="border: 1px solid #010101" width="433" | <br/>
 
| <br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="73" | <br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_SIGNIFICANCE_FORMATTER<br/>
| style="border: 1px solid #010101" width="174" | <br/>
+
| style="border: 1px solid #010101" width="174" | string<br/>
| style="border: 1px solid #010101" width="433" | <br/>
+
| takes a string.format string, default is "{0:[+];[-];,} {1}"<br/>where 0 is int that is positive, negative or zero depending on significance and 1 is the Z value<br/>
| style="border: 1px solid #010101" width="433" | <br/>
 
| <br/>
 
 
|-
 
|-
| style="border: 1px solid #010101" width="73" | <br/>
+
| colspan="1" style="border: 1px solid #010101" width="227" | TABLE_DIAGRAM_STYLE_BORDER_STYLE<br/>
| style="border: 1px solid #010101" width="174" | <br/>
+
| style="border: 1px solid #010101" width="174" | object<br/>
| style="border: 1px solid #010101" width="433" | <br/>
+
| takes a [http://wiki.catglobe.com/index.php/TabulationBorder_class Border object]<br/>
| style="border: 1px solid #010101" width="433" | <br/>
 
| <br/>
 
 
|}
 
|}
 +
 +
===Return type===
 +
 +
Empty
 +
 +
===Examples===
 +
*Before set Table diagram style
 +
[[File:Tabulation setTableDiagramStyle1.png|none]]
 +
 +
 +
<source lang="javascript">
 +
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"});
 +
</source>
 +
 +
*After setting Table diagram style with source above
 +
[[File:Tabulation setTableDiagramStyle2.png|none]]
 +
 +
 +
 +
 +
<source lang="javascript">
 +
DCS_use(15507609);
 +
Tabulation_setTableLayout(TableChartLayout_Classic);
 +
array FoS_header = DiagramFontStyle_getDefault();
 +
FoS_header[DIAGRAM_FONT_STYLE_COLOR] = Color_getByRGB("#307D7E");
 +
 +
array FiS_header = DiagramFillStyle_getDefault();
 +
FiS_header[DIAGRAM_FILL_STYLE_COLOR] =  Color_getByRGB("#AF7817");
 +
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_FONT, FoS_header);
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_FILL, FiS_header);
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_HALIGN, "center");
 +
object customBorderLevel2 = new TabulationBorder("Top,Bottom", 2, "Solid", Color_getByRGB("#000000"));
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderLevel2);
 +
Tabulation_setTableDiagramStyle(TableDiagram_AbsoluteColumn, TABLE_DIAGRAM_STYLE_FONT, FoS_header);
 +
Tabulation_setTableDiagramStyle(TableDiagram_AbsoluteColumn, TABLE_DIAGRAM_STYLE_FILL, FiS_header);
 +
Tabulation_setTableDiagramStyle(TableDiagram_AbsoluteColumn, TABLE_DIAGRAM_STYLE_HALIGN, "center");
 +
 +
 +
//-----------------------------
 +
Tabulation_setTableDiagramStyle(TableDiagram_AbsoluteColumnValue, TABLE_DIAGRAM_STYLE_DECIMAL, 0);
 +
//-----------------------------
 +
FiS_header[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#387C44");
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_DECIMAL, 1);
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_FILL, FiS_header);
 +
Tabulation_setTableDiagramStyle(TableDiagram_PercentageColumn, TABLE_DIAGRAM_STYLE_DECIMAL, 1);
 +
Tabulation_setTableDiagramStyle(TableDiagram_PercentageColumn, TABLE_DIAGRAM_STYLE_FILL, FiS_header);
 +
 +
///////////////////////////////////////////////////////////////
 +
array FoS_default = DiagramFontStyle_getDefault();
 +
FoS_default[DIAGRAM_FONT_STYLE_BOLD] = true; 
 +
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceCell, TABLE_DIAGRAM_STYLE_FONT, FoS_default);
 +
TabulationBorder tb = new TabulationBorder("Left", 2, "Solid", Color_getByRGB("#303030"));
 +
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceCell, TABLE_DIAGRAM_STYLE_BORDER_STYLE, tb);
 +
 +
array FiS_default = DiagramFillStyle_getDefault();
 +
FoS_default[DIAGRAM_FONT_STYLE_BOLD] = false; 
 +
FoS_default[DIAGRAM_FONT_STYLE_COLOR] = Color_getByRGB("#000000");
 +
FiS_default[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#307D7E");
 +
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceRow, TABLE_DIAGRAM_STYLE_FONT, FoS_default);
 +
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceRow, TABLE_DIAGRAM_STYLE_FILL, FiS_default);
 +
 +
createCrossDiagram({"QA1"},{"D_Age_Group"});
 +
</source>
 +
 +
*After setting Table diagram style with source above
 +
[[File:setTableDiagramStyle3.png|none]]
 +
 +
 +
 +
 +
<source lang="javascript">
 +
DCS_use(15507609);
 +
Tabulation_setTableLayout(TableChartLayout_Standard);
 +
 +
Tabulation_setSignificance(true);
 +
Tabulation_setCountAnswer(true);
 +
 +
Tabulation_setMergeStatisticPctItem(true);
 +
Tabulation_setEnableOddEvenRowHeader(true);
 +
 +
Tabulation_setAbsText("abs");
 +
Tabulation_setPctText("%");
 +
Tabulation_setTotalText("Resp.");
 +
//--------------------------------------------------//
 +
array FoS_default = DiagramFontStyle_getDefault();
 +
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();
 +
FiS_default[DIAGRAM_FILL_STYLE_INHERIT] = true;
 +
 +
array DiagramS_default = Tabulation_getDefaultDiagramStyle(Diagram_Type_Table);
 +
DiagramS_default[TABLE_DIAGRAM_STYLE_FONT] = FoS_default;
 +
DiagramS_default[TABLE_DIAGRAM_STYLE_FILL] = FiS_default;
 +
DiagramS_default[TABLE_DIAGRAM_STYLE_VALIGN] = "center";
 +
DiagramS_default[TABLE_DIAGRAM_STYLE_HALIGN] = "right";
 +
DiagramS_default[TABLE_DIAGRAM_STYLE_DECIMAL] = 0;
 +
 +
Tabulation_setDiagramStyle(TableDiagram_AllTable, DiagramS_default);
 +
//--------------------------------------------------//
 +
FiS_default[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#FFFFFF");
 +
FiS_default[DIAGRAM_FILL_STYLE_INHERIT] = false;
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeader, TABLE_DIAGRAM_STYLE_FILL, FiS_default);
 +
 +
FoS_default[DIAGRAM_FONT_STYLE_BOLD] = true;
 +
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceCell, TABLE_DIAGRAM_STYLE_FONT, FoS_default);
 +
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceCell, TABLE_DIAGRAM_STYLE_HALIGN, "right");
 +
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_HALIGN, "center");
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_HALIGN, "center");
 +
 +
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceRowValue, TABLE_DIAGRAM_STYLE_HALIGN, "center");
 +
object customBorderAllTable = new TabulationBorder("Top,Bottom,Left,Right", 0, "None", Color_getByRGB("#000000"));
 +
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderAllTable);
 +
object customBorderHeaderLevel1 = new TabulationBorder("Bottom", 1, "Solid", Color_getByRGB("#000000"));
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderHeaderLevel1);
 +
object customBorderHeaderLevel2 = new TabulationBorder("Top,Bottom", 1, "Solid", Color_getByRGB("#000000"));
 +
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderHeaderLevel2);
 +
object customBorderTotalRowValue = new TabulationBorder("Top", 1, "Solid", Color_getByRGB("#000000"));
 +
Tabulation_setTableDiagramStyle(TableDiagram_TotalRowValue, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderTotalRowValue);
 +
object customBorderSpacerCell = new TabulationBorder("All", 0, "None", Color_getByRGB("#000000"));
 +
Tabulation_setTableDiagramStyle(TableDiagram_SpacerCell, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderSpacerCell);
 +
 +
 +
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_NUMBER_FORMATTER, "{0:##,#;(##,#)}");
 +
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_PERCENT_FORMATTER, "{0:##,#;(##,#)}");
 +
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_SIGNIFICANCE_FORMATTER, "{1}{0:+;-;,}");
 +
 +
createCrossDiagram({"QA1"},{"D_Age_Group"});
 +
</source>
 +
*After setting Table diagram style with source above
 +
[[File:setTableDiagramStyle4.png|none]]
 +
 +
__NOTOC__

Latest revision as of 08:30, 22 September 2023



Tabulation_setTableDiagramStyle

Sets the style for a chart.

Syntax

Tabulation_setTableDiagramStyle(styleType, tableDiagramStyle, argTableDiagramStyle);

can use TabulationDiagramParameter.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

Argument 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+"}" ex: {0:0.00}
TABLE_DIAGRAM_STYLE_PERCENT_FORMATTER
string
takes a string.format string, default is "{0:"+decimalplaces+"}%" ex: {0:0.00}%
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
Tabulation setTableDiagramStyle1.png


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 setting Table diagram style with source above
Tabulation setTableDiagramStyle2.png



DCS_use(15507609);
Tabulation_setTableLayout(TableChartLayout_Classic);
array FoS_header = DiagramFontStyle_getDefault(); 
FoS_header[DIAGRAM_FONT_STYLE_COLOR] = Color_getByRGB("#307D7E");

array FiS_header = DiagramFillStyle_getDefault();
FiS_header[DIAGRAM_FILL_STYLE_COLOR] =  Color_getByRGB("#AF7817");

Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_FONT, FoS_header);
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_FILL, FiS_header);
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_HALIGN, "center");
object customBorderLevel2 = new TabulationBorder("Top,Bottom", 2, "Solid", Color_getByRGB("#000000"));
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderLevel2);
Tabulation_setTableDiagramStyle(TableDiagram_AbsoluteColumn, TABLE_DIAGRAM_STYLE_FONT, FoS_header);
Tabulation_setTableDiagramStyle(TableDiagram_AbsoluteColumn, TABLE_DIAGRAM_STYLE_FILL, FiS_header);
Tabulation_setTableDiagramStyle(TableDiagram_AbsoluteColumn, TABLE_DIAGRAM_STYLE_HALIGN, "center");


//-----------------------------
Tabulation_setTableDiagramStyle(TableDiagram_AbsoluteColumnValue, TABLE_DIAGRAM_STYLE_DECIMAL, 0);
//-----------------------------
FiS_header[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#387C44");
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_DECIMAL, 1);
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_FILL, FiS_header);
Tabulation_setTableDiagramStyle(TableDiagram_PercentageColumn, TABLE_DIAGRAM_STYLE_DECIMAL, 1);
Tabulation_setTableDiagramStyle(TableDiagram_PercentageColumn, TABLE_DIAGRAM_STYLE_FILL, FiS_header);

///////////////////////////////////////////////////////////////
array FoS_default = DiagramFontStyle_getDefault(); 
FoS_default[DIAGRAM_FONT_STYLE_BOLD] = true;  
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceCell, TABLE_DIAGRAM_STYLE_FONT, FoS_default);
TabulationBorder tb = new TabulationBorder("Left", 2, "Solid", Color_getByRGB("#303030"));
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceCell, TABLE_DIAGRAM_STYLE_BORDER_STYLE, tb);

array FiS_default = DiagramFillStyle_getDefault();
FoS_default[DIAGRAM_FONT_STYLE_BOLD] = false;  
FoS_default[DIAGRAM_FONT_STYLE_COLOR] = Color_getByRGB("#000000");
FiS_default[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#307D7E");
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceRow, TABLE_DIAGRAM_STYLE_FONT, FoS_default);
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceRow, TABLE_DIAGRAM_STYLE_FILL, FiS_default);

createCrossDiagram({"QA1"},{"D_Age_Group"});
  • After setting Table diagram style with source above
SetTableDiagramStyle3.png



DCS_use(15507609);
Tabulation_setTableLayout(TableChartLayout_Standard);

Tabulation_setSignificance(true);
Tabulation_setCountAnswer(true);

Tabulation_setMergeStatisticPctItem(true);
Tabulation_setEnableOddEvenRowHeader(true);

Tabulation_setAbsText("abs");
Tabulation_setPctText("%");
Tabulation_setTotalText("Resp.");
//--------------------------------------------------//
array FoS_default = DiagramFontStyle_getDefault();
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();
FiS_default[DIAGRAM_FILL_STYLE_INHERIT] = true;

array DiagramS_default = Tabulation_getDefaultDiagramStyle(Diagram_Type_Table);
DiagramS_default[TABLE_DIAGRAM_STYLE_FONT] = FoS_default;
DiagramS_default[TABLE_DIAGRAM_STYLE_FILL] = FiS_default;
DiagramS_default[TABLE_DIAGRAM_STYLE_VALIGN] = "center";
DiagramS_default[TABLE_DIAGRAM_STYLE_HALIGN] = "right";
DiagramS_default[TABLE_DIAGRAM_STYLE_DECIMAL] = 0;

Tabulation_setDiagramStyle(TableDiagram_AllTable, DiagramS_default);
//--------------------------------------------------//
FiS_default[DIAGRAM_FILL_STYLE_COLOR] = Color_getByRGB("#FFFFFF");
FiS_default[DIAGRAM_FILL_STYLE_INHERIT] = false;
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeader, TABLE_DIAGRAM_STYLE_FILL, FiS_default);

FoS_default[DIAGRAM_FONT_STYLE_BOLD] = true;
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceCell, TABLE_DIAGRAM_STYLE_FONT, FoS_default);
Tabulation_setTableDiagramStyle(TableDiagram_SignificanceCell, TABLE_DIAGRAM_STYLE_HALIGN, "right");

Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_HALIGN, "center");
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_HALIGN, "center");

Tabulation_setTableDiagramStyle(TableDiagram_SignificanceRowValue, TABLE_DIAGRAM_STYLE_HALIGN, "center");
object customBorderAllTable = new TabulationBorder("Top,Bottom,Left,Right", 0, "None", Color_getByRGB("#000000"));
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderAllTable);
object customBorderHeaderLevel1 = new TabulationBorder("Bottom", 1, "Solid", Color_getByRGB("#000000"));
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel1, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderHeaderLevel1);
object customBorderHeaderLevel2 = new TabulationBorder("Top,Bottom", 1, "Solid", Color_getByRGB("#000000"));
Tabulation_setTableDiagramStyle(TableDiagram_ColumnHeaderLevel2, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderHeaderLevel2);
object customBorderTotalRowValue = new TabulationBorder("Top", 1, "Solid", Color_getByRGB("#000000"));
Tabulation_setTableDiagramStyle(TableDiagram_TotalRowValue, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderTotalRowValue);
object customBorderSpacerCell = new TabulationBorder("All", 0, "None", Color_getByRGB("#000000"));
Tabulation_setTableDiagramStyle(TableDiagram_SpacerCell, TABLE_DIAGRAM_STYLE_BORDER_STYLE, customBorderSpacerCell);


Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_NUMBER_FORMATTER, "{0:##,#;(##,#)}");
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_PERCENT_FORMATTER, "{0:##,#;(##,#)}");
Tabulation_setTableDiagramStyle(TableDiagram_AllTable, TABLE_DIAGRAM_STYLE_SIGNIFICANCE_FORMATTER, "{1}{0:+;-;,}");

createCrossDiagram({"QA1"},{"D_Age_Group"});
  • After setting Table diagram style with source above
SetTableDiagramStyle4.png