Difference between revisions of "FixedCrossTable class"
Line 27: | Line 27: | ||
{{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}} | {{CGscriptProperties_Template|ReturnType=TypeInformation|Name=TypeInformation|HasGetter=1|Description=Get information about this class.}} | ||
}} | }} | ||
+ | |||
+ | === Examples For Table 1x0 === | ||
+ | |||
+ | <source lang="javascript"> | ||
+ | DCS_use(12344983); | ||
+ | |||
+ | // Get Axis: | ||
+ | array axisNew = Axis_new("LuuTest"); | ||
+ | axisNew[AXIS_TEXT] = "Choose a D_Week"; | ||
+ | |||
+ | // Init: | ||
+ | FixedCrossTableRowSeries rowseries; | ||
+ | FixedCrossTableDataSeries dataserie; | ||
+ | FixedCrossTableDataItem dataItemAbs; | ||
+ | FixedCrossTableDataItem dataItemPct; | ||
+ | // Set up a table | ||
+ | // table 1x0 | ||
+ | rowseries = new FixedCrossTableRowSeries(); | ||
+ | dataserie = new FixedCrossTableDataSeries(); | ||
+ | number count; | ||
+ | number countTotal = count() where D_Week != empty; | ||
+ | |||
+ | for(number i = 201301; i < 201305; i++) | ||
+ | { | ||
+ | Axis_addOption(axisNew, AxisOption_new("Week " + i.ToString(), "")); | ||
+ | |||
+ | count = count() where D_Week == i; | ||
+ | dataItemAbs = new FixedCrossTableDataItem(); | ||
+ | dataItemAbs.Value = count; | ||
+ | dataItemPct = new FixedCrossTableDataItem(); | ||
+ | dataItemPct.Value = count*100/countTotal; | ||
+ | dataserie.Add(dataItemAbs,dataItemPct); | ||
+ | } | ||
+ | // other | ||
+ | Axis_addOption(axisNew, AxisOption_new("Week Other", "")); | ||
+ | count = count() where D_Week != [201301-201304] && D_Week != empty; | ||
+ | |||
+ | dataItemAbs = new FixedCrossTableDataItem(); | ||
+ | dataItemAbs.Value = count; | ||
+ | dataItemPct = new FixedCrossTableDataItem(); | ||
+ | dataItemPct.Value = count*100/countTotal; | ||
+ | dataserie.Add(dataItemAbs,dataItemPct); | ||
+ | |||
+ | dataserie.AbsoluteTotal.Value = countTotal; | ||
+ | dataserie.PercentageTotal.Value = countTotal*100/countTotal; | ||
+ | |||
+ | rowseries.Add(dataserie); | ||
+ | FixedCrossTable table1x0 = new FixedCrossTable("Create by createFixedCrossDiagram - D_Week", axisNew , rowseries, empty); | ||
+ | // genarate table: | ||
+ | createFixedCrossDiagram(table1x0); | ||
+ | </source> Result:<br/>[[File:Tabu Table1x0.png]] |
Revision as of 07:51, 7 December 2015
FixedCrossTable
A resource journal entry
Constructors
- (string rowTitle "Title of row.", array primaryRowAxis "Axis from Axis_xxx function for the primary row axis.", FixedCrossTableRowSeries rowSeries "Data for the table.", array statisticsValues "Array of StatisticsItems.") - Create new 1x0 FixedCrossTable.
- (string rowTitle "Title of row.", array primaryRowAxis "Axis from Axis_xxx function for the primary row axis.", array secondaryRowAxis "Axis from Axis_xxx function for the secondary row axis.", array rowSeries "Data for the table.", array statisticsValues "Array of StatisticsItems.") - Create new 2x0 FixedCrossTable.
- (string rowTitle "Title of row.", array primaryRowAxis "Axis from Axis_xxx function for the primary row axis.", string colTitle "Title of column.", array primaryColAxis "Axis from Axis_xxx function for the primary column axis.", array rowSeries "Data for the table.", array statisticsValues "Array of StatisticsItems.") - Create new 1x1 FixedCrossTable.
- (string rowTitle "Title of row.", array primaryRowAxis "Axis from Axis_xxx function for the primary row axis.", string colTitle "Title of column.", array primaryColAxis "Axis from Axis_xxx function for the primary column axis.", array secondaryColAxis "Axis from Axis_xxx function for the secondary column axis.", FixedCrossTableRowSeries rowSeries "Data for the table.", array statisticsValues "Array of StatisticsItems.") - Create new 1x2 FixedCrossTable.
- (string rowTitle "Title of row.", array primaryRowAxis "Axis from Axis_xxx function for the primary row axis.", array secondaryRowAxis "Axis from Axis_xxx function for the secondary row axis.", string colTitle "Title of column.", array primaryColAxis "Axis from Axis_xxx function for the primary column axis.", array rowSeries "Data for the table.", array statisticsValues "Array of StatisticsItems.") - Create new 2x1 FixedCrossTable.
- (string rowTitle "Title of row.", array primaryRowAxis "Axis from Axis_xxx function for the primary row axis.", array secondaryRowAxis "Axis from Axis_xxx function for the secondary row axis.", string colTitle "Title of column.", array primaryColAxis "Axis from Axis_xxx function for the primary column axis.", array secondaryColAxis "Axis from Axis_xxx function for the secondary column axis.", array rowSeries "Data for the table.", array statisticsValues "Array of StatisticsItems.") - Create new 2x2 FixedCrossTable.
Methods
- string ToString() - The string representation of the object.
Properties
- string ObjectTypeName { get; } - The name of the type of object.
- TypeInformation TypeInformation { get; } - Get information about this class.
Examples For Table 1x0
DCS_use(12344983);
// Get Axis:
array axisNew = Axis_new("LuuTest");
axisNew[AXIS_TEXT] = "Choose a D_Week";
// Init:
FixedCrossTableRowSeries rowseries;
FixedCrossTableDataSeries dataserie;
FixedCrossTableDataItem dataItemAbs;
FixedCrossTableDataItem dataItemPct;
// Set up a table
// table 1x0
rowseries = new FixedCrossTableRowSeries();
dataserie = new FixedCrossTableDataSeries();
number count;
number countTotal = count() where D_Week != empty;
for(number i = 201301; i < 201305; i++)
{
Axis_addOption(axisNew, AxisOption_new("Week " + i.ToString(), ""));
count = count() where D_Week == i;
dataItemAbs = new FixedCrossTableDataItem();
dataItemAbs.Value = count;
dataItemPct = new FixedCrossTableDataItem();
dataItemPct.Value = count*100/countTotal;
dataserie.Add(dataItemAbs,dataItemPct);
}
// other
Axis_addOption(axisNew, AxisOption_new("Week Other", ""));
count = count() where D_Week != [201301-201304] && D_Week != empty;
dataItemAbs = new FixedCrossTableDataItem();
dataItemAbs.Value = count;
dataItemPct = new FixedCrossTableDataItem();
dataItemPct.Value = count*100/countTotal;
dataserie.Add(dataItemAbs,dataItemPct);
dataserie.AbsoluteTotal.Value = countTotal;
dataserie.PercentageTotal.Value = countTotal*100/countTotal;
rowseries.Add(dataserie);
FixedCrossTable table1x0 = new FixedCrossTable("Create by createFixedCrossDiagram - D_Week", axisNew , rowseries, empty);
// genarate table:
createFixedCrossDiagram(table1x0);