Difference between revisions of "Tabulation setSortVerticalWhichColumn"

From Catglobe Wiki
Jump to: navigation, search
 
Line 29: Line 29:
  
 
<source lang="javascript">
 
<source lang="javascript">
DCS_use(15569074);
+
// Example for vertical sort on 1x1
 +
DCS_use(14913246);
 +
Tabulation_setSortOrderVertical(Tabulation_SortOrder_HighToLow);
 +
Tabulation_setSortVerticalWhichColumn(1);
 +
createCrossDiagram({"D_Region_Detailed"},{"D_Gender"});
 +
</source>
 +
 
 +
Before set sort
 +
 
 +
[[File:2020-03-04 15-02-41.png]]
 +
 
 +
 
 +
After set sort vertical high to low on second column
 +
 
 +
[[File:2020-03-04_15-14-12.png]]
 +
 
 +
<source lang="javascript">
 +
// Example for vertical sort on 1x2
 +
DCS_use(14913246);
 
Tabulation_setSortOrderVertical(Tabulation_SortOrder_LowToHigh);
 
Tabulation_setSortOrderVertical(Tabulation_SortOrder_LowToHigh);
 
Tabulation_setSortVerticalWhichColumn(1);
 
Tabulation_setSortVerticalWhichColumn(1);
createCrossDiagram({"Q2"}, {"Panel_Age"});
+
createCrossDiagram({"D_Region_Detailed"},{"D_Gender","D_Age"});
 
</source>
 
</source>
  
Before set sort vertical low to high which column 1
 
[[File:Vertical_sort_before.png]]
 
  
 +
Before sort:
 +
 +
[[File:2020-03-04_14-47-55.png]]
  
After set sort vertical low to high which column 1
+
After sort the second column from low to high  
 +
[[File:2020-03-04_14-46-28.png]]
  
[[File:Vertical_sort.png]]
 
  
  
 
<source lang="javascript">
 
<source lang="javascript">
// Example for vertical sort on double mode
+
// Example for vertical sort on 2x1
DCS_use(15569074);
+
DCS_use(14913246);
 
Tabulation_setSortOrderVertical(Tabulation_SortOrder_HighToLow);
 
Tabulation_setSortOrderVertical(Tabulation_SortOrder_HighToLow);
 
Tabulation_setSortVerticalWhichColumn(1);
 
Tabulation_setSortVerticalWhichColumn(1);
createCrossDiagram({"Panel_Age","Panel_Gender"},{"Q2"});
+
createCrossDiagram({"D_Region_Detailed","D_Gender"},{"D_Age"});
 
</source>
 
</source>
[[File:Vertical_sort_for_double_mode.png]]
+
 
 +
Before sort
 +
 
 +
[[File:2020-03-04_15-27-30.png]]
 +
 
 +
After sort the second column high to low
 +
 
 +
[[File:2020-03-04_15-28-14.png]]

Latest revision as of 09:44, 4 March 2020


Tabulation_setSortVerticalWhichColumn

Define which column should be sort.

Use combine with

Tabulation_setSortOrderVertical(Tabulation_SortOrder_LowToHigh);

or

Tabulation_setSortOrderVertical(Tabulation_SortOrder_HighToLow);


Syntax

Tabulation_setSortVerticalWhichColumn( column);

Arguments

column: is a number expression. It's the column you want to sort (start with 0)

Return type

empty

Example

// Example for vertical sort on 1x1
DCS_use(14913246);
Tabulation_setSortOrderVertical(Tabulation_SortOrder_HighToLow);
Tabulation_setSortVerticalWhichColumn(1);
createCrossDiagram({"D_Region_Detailed"},{"D_Gender"});

Before set sort

2020-03-04 15-02-41.png


After set sort vertical high to low on second column

2020-03-04 15-14-12.png

// Example for vertical sort on 1x2
DCS_use(14913246);
Tabulation_setSortOrderVertical(Tabulation_SortOrder_LowToHigh);
Tabulation_setSortVerticalWhichColumn(1);
createCrossDiagram({"D_Region_Detailed"},{"D_Gender","D_Age"});


Before sort:

2020-03-04 14-47-55.png

After sort the second column from low to high 2020-03-04 14-46-28.png


// Example for vertical sort on 2x1
DCS_use(14913246);
Tabulation_setSortOrderVertical(Tabulation_SortOrder_HighToLow);
Tabulation_setSortVerticalWhichColumn(1);
createCrossDiagram({"D_Region_Detailed","D_Gender"},{"D_Age"});

Before sort

2020-03-04 15-27-30.png

After sort the second column high to low

2020-03-04 15-28-14.png