Difference between revisions of "CreateFixedCrossDiagram"
(Blanked the page) |
|||
Line 1: | Line 1: | ||
+ | {{HelpFiles}} | ||
+ | ==== createFixedCrossDiagram ==== | ||
+ | |||
+ | Creates a cross diagram from the axis names specified as string arrays for rows and columns. A unique id is returned when a diagram is added. | ||
+ | |||
+ | '''Syntax''' | ||
+ | |||
+ | createFixedCrossDiagram(FixedCrossTable) | ||
+ | |||
+ | '''Arguments''' | ||
+ | |||
+ | FixedCrossTable'':'' An FixedCrossTable expression. | ||
+ | |||
+ | '''Return type''' | ||
+ | |||
+ | ''number'' | ||
+ | |||
+ | '''Examples''' | ||
+ | |||
+ | {| border="1" cellspacing="0" cellpadding="0" style="width: 1000px" | ||
+ | |- | ||
+ | | <div>DCS_use(15517112);</div><div> </div><div>// Get Axis:</div><div>array axisPrimary = Axis_new("LuuTest1");</div><div>axisPrimary[AXIS_TEXT] = "Choose a D_Week";</div><div> </div><div>array axisSecond = Axis_new("LuuTest2");</div><div>axisSecond[AXIS_TEXT] = "Choose a Region";</div><div> </div><div>Axis_addOption(axisPrimary, AxisOption_new("Year 2014", ""));</div><div>Axis_addOption(axisPrimary, AxisOption_new("Other Year", ""));</div><div> </div><div>Axis_addOption(axisSecond, AxisOption_new("Male", ""));</div><div>Axis_addOption(axisSecond, AxisOption_new("Female", ""));</div><div>// Init:</div><div>array arrRowseries ={};</div><div>number countTotal = count() where true;</div><div>number count;</div><div>FixedCrossTableRowSeries rowseries;</div><div>FixedCrossTableDataItem dataItemAbs;</div><div>FixedCrossTableDataItem dataItemPct;</div><div>FixedCrossTableDataSeries dataserie;</div><div> </div><div>dataserie = new FixedCrossTableDataSeries();</div><div>count = count() where D_Week == [201401-201453] && Gender == [1];</div><div>dataItemAbs = new FixedCrossTableDataItem();</div><div>dataItemAbs.Value = count;</div><div>dataItemPct = new FixedCrossTableDataItem();</div><div>dataItemPct.Value = count*100/countTotal;</div><div>dataserie.Add(dataItemAbs,dataItemPct);</div><div> </div><div>count = count() where D_Week == [201401-201453] && Gender == [2];</div><div>dataItemAbs = new FixedCrossTableDataItem();</div><div>dataItemAbs.Value = count;</div><div>dataItemPct = new FixedCrossTableDataItem();</div><div>dataItemPct.Value = count*100/countTotal;</div><div>dataserie.Add(dataItemAbs,dataItemPct);</div><div> </div><div>count = count() where D_Week == [201401-201453];</div><div>dataserie.AbsoluteTotal.Value = count;</div><div>dataserie.PercentageTotal.Value = count/count * 100;</div><div>rowseries.Add(dataserie);</div><div>arrRowseries = {rowseries,rowseries,rowseries};</div><div>// Set up a table</div><div>// table 2x0</div><div> </div><div> </div><div>FixedCrossTable table1x1 = new FixedCrossTable("Create by createFixedCrossDiagram ", axisPrimary,"Col title", axisSecond, arrRowseries, empty);</div><div>// genarate table:</div><div>createFixedCrossDiagram(table1x1);</div> | ||
+ | |} | ||
+ | |||
+ | '''Availability''' | ||
+ | |||
+ | Version 6.0 __NOTOC__ | ||
+ | <!-- imported from file: 4223.htm--> |
Revision as of 03:18, 8 December 2015
createFixedCrossDiagram
Creates a cross diagram from the axis names specified as string arrays for rows and columns. A unique id is returned when a diagram is added.
Syntax
createFixedCrossDiagram(FixedCrossTable)
Arguments
FixedCrossTable: An FixedCrossTable expression.
Return type
number
Examples
DCS_use(15517112); // Get Axis: array axisPrimary = Axis_new("LuuTest1"); axisPrimary[AXIS_TEXT] = "Choose a D_Week"; array axisSecond = Axis_new("LuuTest2"); axisSecond[AXIS_TEXT] = "Choose a Region"; Axis_addOption(axisPrimary, AxisOption_new("Year 2014", "")); Axis_addOption(axisPrimary, AxisOption_new("Other Year", "")); Axis_addOption(axisSecond, AxisOption_new("Male", "")); Axis_addOption(axisSecond, AxisOption_new("Female", "")); // Init: array arrRowseries ={}; number countTotal = count() where true; number count; FixedCrossTableRowSeries rowseries; FixedCrossTableDataItem dataItemAbs; FixedCrossTableDataItem dataItemPct; FixedCrossTableDataSeries dataserie; dataserie = new FixedCrossTableDataSeries(); count = count() where D_Week == [201401-201453] && Gender == [1]; dataItemAbs = new FixedCrossTableDataItem(); dataItemAbs.Value = count; dataItemPct = new FixedCrossTableDataItem(); dataItemPct.Value = count*100/countTotal; dataserie.Add(dataItemAbs,dataItemPct); count = count() where D_Week == [201401-201453] && Gender == [2]; dataItemAbs = new FixedCrossTableDataItem(); dataItemAbs.Value = count; dataItemPct = new FixedCrossTableDataItem(); dataItemPct.Value = count*100/countTotal; dataserie.Add(dataItemAbs,dataItemPct); count = count() where D_Week == [201401-201453]; dataserie.AbsoluteTotal.Value = count; dataserie.PercentageTotal.Value = count/count * 100; rowseries.Add(dataserie); arrRowseries = {rowseries,rowseries,rowseries}; // Set up a table // table 2x0 FixedCrossTable table1x1 = new FixedCrossTable("Create by createFixedCrossDiagram ", axisPrimary,"Col title", axisSecond, arrRowseries, empty); // genarate table: createFixedCrossDiagram(table1x1);
|
Availability
Version 6.0