롤리팝 분산

LollipopVariSparkline 함수를 사용하면 두 데이터 집합을 비교하고 값 간의 상대 또는 절대 분산을 계산한 다음 이러한 분산을 롤리팝 차트에 표시할 수 있습니다.

다음 수식을 통해 LollipopVariSparkline 함수를 사용하여 롤리팝 분산 스파크라인을 만들 수 있습니다. =LOLLIPOPVARISPARKLINE(plannedValue, actualValue ,index ,absolute?,reference?, mini?, maxi?, tickunit?, legend?, colorPositive?, colorNegative?, lollipopHeaderColor?, vertical?). 이 함수에는 다음과 같은 매개 변수가 있습니다. plannedValue: 예상되는 데이터 집합을 나타내는 [숫자 또는 참조]입니다. 계획된 값 영역의 전체 범위를 전달해야 합니다. 예를 들면“B2:B8“ 또는 "{0;1;2;3;4;5;6}"입니다. actualValue: 실제 데이터 집합을 나타내는 [숫자 또는 참조]입니다. 실제 값 영역의 전체 범위를 전달해야 합니다. 예를 들면 “C2:C8“ 또는 "{0;1;2;3;4;5;6}"입니다. index: plannedValue 및 actualValue의 데이터 인덱스를 나타내는 [숫자 또는 참조]입니다. 가로 도표의 경우 행 인덱스와 관련이 있고, 세로 도표의 경우 열 인덱스와 관련이 있습니다. 인덱스는 0부터 시작합니다. absolute: (선택 사항) 롤리팝 미니 그래프가 절대 분산을 나타내는지 상대 분산을 나타내는지 결정하는 [부울]입니다. reference: (선택 사항) 참조 선의 위치를 나타내는 [숫자 또는 참조]입니다(예: 0 또는 "A2"). 상대 분산에서만 사용되며, 기본값은 0입니다. mini: (선택 사항) 스파크라인의 최소값을 나타내는 [숫자 또는 참조]입니다(예: -5 또는 "A3"). 상대 분산에서만 사용되며, 기본값은 -1입니다. maxi: (선택 사항) 스파크라인의 최대값을 나타내는 [숫자 또는 참조]입니다(예: 5 또는 "A4"). 상대 분산에서만 사용되며, 기본값은 -1입니다. tickunit: (선택 사항) 눈금 단위를 나타내는 [숫자 또는 참조]입니다(예: 1 또는 "A6"). 기본값은 0입니다. legend: (선택 사항) 텍스트의 표시 여부를 나타내는 [부울]입니다. 기본값은 false입니다. colorPositive: (선택 사항) 분산이 참조보다 큰 경우의 색 구성표를 나타내는 [문자열]입니다. 기본값은 "green"입니다. colorNegative: (선택 사항) 분산이 참조보다 작은 경우의 색 구성표를 나타내는 [문자열]입니다. 기본값은 "red"입니다. lollipopHeaderColor: (선택 사항) 롤리팝 헤더 채우기 색의 색 구성표를 나타내는 [문자열]입니다. 기본값은 "black"입니다. vertical: (선택 사항) 상자의 방향이 세로 또는 가로인지 나타내는 [부울]입니다. 기본값은 false입니다.
import * as React from 'react'; import * as ReactDOM from 'react-dom'; import './styles.css'; import { AppFunc } from './app-func'; // import { App } from './app-class'; // 1. Functional Component sample ReactDOM.render(<AppFunc />, document.getElementById('app')); // 2. Class Component sample // ReactDOM.render(<App />, document.getElementById('app'));
import * as React from 'react'; import GC from '@mescius/spread-sheets'; import { SpreadSheets, Worksheet } from '@mescius/spread-sheets-react'; import '@mescius/spread-sheets-resources-ko'; GC.Spread.Common.CultureManager.culture("ko-kr"); export function AppFunc() { let spread = null; const initHorizontalSheet = (spread) => { let sheet = spread.getActiveSheet(); sheet.setFormula(1, 3, '=LOLLIPOPVARISPARKLINE($C$2:$C$13,$B$2:$B$13,SEQUENCE(12,1,0,1),true,0,,,0,true,"#a0ba25","#b46624","#ffa501")'); sheet.setFormula(1, 4, '=LOLLIPOPVARISPARKLINE($C$2:$C$13,$B$2:$B$13,SEQUENCE(12,1,0,1),false,0,,,0,true,"#a0ba25","#b46624","black")'); } const initVerticalSheet = (spread) => { let sheet2 = spread.getSheet(1); sheet2.setFormula(4, 1, '=LOLLIPOPVARISPARKLINE($B$2:$I$2,$B$3:$I$3,SEQUENCE(1,8,0,1),false,0,-0.3,0.3,1000,true,"#c0c0c0","#c0c0c0","#ffa501",true)'); sheet2.setFormula(3, 1, '=LOLLIPOPVARISPARKLINE($B$2:$I$2,$B$3:$I$3,SEQUENCE(1,8,0,1),true,0,,,1000,true,"#c0c0c0","#c0c0c0","#ffa501",true)'); } const initSpread = (currSpread) => { spread = currSpread; spread.fromJSON(IncomeStatement); spread.options.allowDynamicArray = true; spread.suspendPaint(); initHorizontalSheet(spread); initVerticalSheet(spread); spread.resumePaint(); } return ( <div class="sample-tutorial"> <div class="sample-spreadsheets"> <SpreadSheets workbookInitialized={spread => initSpread(spread)}> <Worksheet> </Worksheet> <Worksheet> </Worksheet> </SpreadSheets> </div> </div> ); }
import * as React from 'react'; import GC from '@mescius/spread-sheets'; import { SpreadSheets, Worksheet } from '@mescius/spread-sheets-react'; import '@mescius/spread-sheets-resources-ko'; GC.Spread.Common.CultureManager.culture("ko-kr"); const Component = React.Component; export class App extends Component { constructor(props) { super(props); this.spread = null; } render() { return ( <div class="sample-tutorial"> <div class="sample-spreadsheets"> <SpreadSheets workbookInitialized={spread => this.initSpread(spread)}> <Worksheet> </Worksheet> <Worksheet> </Worksheet> </SpreadSheets> </div> </div> ); } initHorizontalSheet(spread) { let sheet = spread.getActiveSheet(); sheet.setFormula(1, 3, '=LOLLIPOPVARISPARKLINE($C$2:$C$13,$B$2:$B$13,SEQUENCE(12,1,0,1),true,0,,,0,true,"#a0ba25","#b46624","#ffa501")'); sheet.setFormula(1, 4, '=LOLLIPOPVARISPARKLINE($C$2:$C$13,$B$2:$B$13,SEQUENCE(12,1,0,1),false,0,,,0,true,"#a0ba25","#b46624","black")'); } initVerticalSheet(spread) { let sheet2 = spread.getSheet(1); sheet2.setFormula(4, 1, '=LOLLIPOPVARISPARKLINE($B$2:$I$2,$B$3:$I$3,SEQUENCE(1,8,0,1),false,0,-0.3,0.3,1000,true,"#c0c0c0","#c0c0c0","#ffa501",true)'); sheet2.setFormula(3, 1, '=LOLLIPOPVARISPARKLINE($B$2:$I$2,$B$3:$I$3,SEQUENCE(1,8,0,1),true,0,,,1000,true,"#c0c0c0","#c0c0c0","#ffa501",true)'); } initSpread(spread) { this.spread = spread; spread.fromJSON(IncomeStatement); spread.options.allowDynamicArray = true; spread.suspendPaint(); this.initHorizontalSheet(spread); this.initVerticalSheet(spread); spread.resumePaint(); } }
<!doctype html> <html style="height:100%;font-size:14px;"> <head> <meta charset="utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" type="text/css" href="$DEMOROOT$/ko/react/node_modules/@mescius/spread-sheets/styles/gc.spread.sheets.excel2013white.css"> <script src="$DEMOROOT$/spread/source/data/PlannedAndActualIncomeStatement.js" type="text/javascript"></script> <!-- SystemJS --> <script src="$DEMOROOT$/ko/react/node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('$DEMOROOT$/ko/lib/react/license.js').then(function () { System.import('./src/app'); }); </script> </head> <body> <div id="app" style="height: 100%;"></div> </body> </html>
.sample-tutorial { position: relative; height: 100%; overflow: hidden; } body { position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .sample-spreadsheets { height: 100%; width: 100%; }
(function (global) { System.config({ transpiler: 'plugin-babel', babelOptions: { es2015: true, react: true }, meta: { '*.css': { loader: 'css' } }, paths: { // paths serve as alias 'npm:': 'node_modules/' }, // map tells the System loader where to look for things map: { '@mescius/spread-sheets': 'npm:@mescius/spread-sheets/index.js', '@mescius/spread-sheets-react': 'npm:@mescius/spread-sheets-react/index.js', '@mescius/spread-sheets-resources-ko': 'npm:@mescius/spread-sheets-resources-ko/index.js', '@grapecity/jsob-test-dependency-package/react-components': 'npm:@grapecity/jsob-test-dependency-package/react-components/index.js', 'react': 'npm:react/umd/react.production.min.js', 'react-dom': 'npm:react-dom/umd/react-dom.production.min.js', 'css': 'npm:systemjs-plugin-css/css.js', 'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js', 'systemjs-babel-build':'npm:systemjs-plugin-babel/systemjs-babel-browser.js' }, // packages tells the System loader how to load when no filename and/or no extension packages: { src: { defaultExtension: 'jsx' }, "node_modules": { defaultExtension: 'js' }, } }); })(this);