轉(zhuǎn)帖|使用教程|編輯:鮑佳佳|2020-08-11 10:44:46.217|閱讀 291 次
概述:您可以根據(jù)一個范圍單元格的數(shù)據(jù)在某一個單元格中創(chuàng)建一張縮略圖。也可以創(chuàng)建柱形圖,折線圖,盈虧圖這三類基本迷你圖,也可以創(chuàng)建自定義的迷你圖。本文主要對創(chuàng)建堆積函數(shù)迷你圖進(jìn)行詳細(xì)說明。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關(guān)鏈接:
SpreadJS是一款基于HTML5的純前端表格控件,兼容450種以上的Excel公式,具備“高性能、跨平臺、與 Excel 高度兼容”的產(chǎn)品特性,備受華為、蘇寧易購、天弘基金、遠(yuǎn)光軟件等各領(lǐng)域龍頭企業(yè)的青睞,并被中國軟件行業(yè)協(xié)會認(rèn)定為“中國優(yōu)秀軟件產(chǎn)品”。
創(chuàng)建堆積函數(shù)迷你圖
StackedSparkline函數(shù)有以下這些參數(shù):
你可以通過堆積函數(shù)創(chuàng)建一個堆積函數(shù)迷你圖,比如:
=STACKEDSPARKLINE(points, colorRange?, labelRange?, maximum?, targetRed?, targetGreen?, targetBlue?, tragetYellow?, color?, highlightPosition?, vertical?, textOrientation?, textSize?)
下面代碼展示了如何創(chuàng)建堆積函數(shù)迷你圖
activeSheet.addSpan(0, 0, 1, 5); activeSheet.getCell(0, 0, GC.Spread.Sheets.SheetArea.viewport).value("Sales by State").font("20px Arial").hAlign(GC.Spread.Sheets.HorizontalAlign.center).vAlign(GC.Spread.Sheets.VerticalAlign.center); var table1 = activeSheet.tables.add("table1", 1, 0, 6, 5, GC.Spread.Sheets.Tables.TableThemes.light12); table1.filterButtonVisible(false); activeSheet.setValue(1, 0, "State"); activeSheet.setValue(1, 1, "Product 1"); activeSheet.setValue(1, 2, "Product 2"); activeSheet.setValue(1, 3, "Product 3"); activeSheet.setValue(1, 4, "Diagram"); activeSheet.setValue(2, 0, "Idaho"); activeSheet.setValue(2, 1, 10000); activeSheet.setValue(2, 2, 12000); activeSheet.setValue(2, 3, 15000); activeSheet.setValue(3, 0, "Montana"); activeSheet.setValue(3, 1, 11000); activeSheet.setValue(3, 2, 10000); activeSheet.setValue(3, 3, 15000); activeSheet.setValue(4, 0, "Oregon"); activeSheet.setValue(4, 1, 10000); activeSheet.setValue(4, 2, 17000); activeSheet.setValue(4, 3, 12000); activeSheet.setValue(5, 0, "Washington"); activeSheet.setValue(5, 1, 15000); activeSheet.setValue(5, 2, 10000); activeSheet.setValue(5, 3, 15000); activeSheet.setValue(6, 0, "Utah"); activeSheet.setValue(6, 1, 10000); activeSheet.setValue(6, 2, 15000); activeSheet.setValue(6, 3, 12000); activeSheet.setValue(7, 1, "orange"); activeSheet.setValue(7, 2, "purple"); activeSheet.setValue(7, 3, "yellowgreen"); activeSheet.getRange(-1, 1, -1, 1).formatter("$#,##0"); activeSheet.getRange(-1, 2, -1, 1).formatter("$#,##0"); activeSheet.getRange(-1, 3, -1, 1).formatter("$#,##0"); activeSheet.setFormula(2, 4, '=STACKEDSPARKLINE(B3:D3,B8:D8,B2:D2,40000)'); activeSheet.setFormula(3, 4, '=STACKEDSPARKLINE(B4:D4,B8:D8,B2:D2,40000)'); activeSheet.setFormula(4, 4, '=STACKEDSPARKLINE(B5:D5,B8:D8,B2:D2,40000)'); activeSheet.setFormula(5, 4, '=STACKEDSPARKLINE(B6:D6,B8:D8,B2:D2,40000)'); activeSheet.setFormula(6, 4, '=STACKEDSPARKLINE(B7:D7,B8:D8,B2:D2,40000)'); activeSheet.setRowHeight(0, 50); activeSheet.setRowHeight(1, 25); for (var i = 2; i < 7; i++) { activeSheet.setRowHeight(i, 45); } activeSheet.setRowHeight(7, 0); activeSheet.setColumnWidth(0, 100); activeSheet.setColumnWidth(1, 120); activeSheet.setColumnWidth(2, 120); activeSheet.setColumnWidth(3, 120); activeSheet.setColumnWidth(4, 200);
本站文章除注明轉(zhuǎn)載外,均為本站原創(chuàng)或翻譯。歡迎任何形式的轉(zhuǎn)載,但請務(wù)必注明出處、不得修改原文相關(guān)鏈接,如果存在內(nèi)容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉(zhuǎn)載自: