轉帖|使用教程|編輯:鮑佳佳|2020-08-11 10:44:46.217|閱讀 291 次
概述:您可以根據一個范圍單元格的數據在某一個單元格中創建一張縮略圖。也可以創建柱形圖,折線圖,盈虧圖這三類基本迷你圖,也可以創建自定義的迷你圖。本文主要對創建堆積函數迷你圖進行詳細說明。
# 界面/圖表報表/文檔/IDE等千款熱門軟控件火熱銷售中 >>
相關鏈接:
SpreadJS是一款基于HTML5的純前端表格控件,兼容450種以上的Excel公式,具備“高性能、跨平臺、與 Excel 高度兼容”的產品特性,備受華為、蘇寧易購、天弘基金、遠光軟件等各領域龍頭企業的青睞,并被中國軟件行業協會認定為“中國優秀軟件產品”。
創建堆積函數迷你圖
StackedSparkline函數有以下這些參數:
你可以通過堆積函數創建一個堆積函數迷你圖,比如:
=STACKEDSPARKLINE(points, colorRange?, labelRange?, maximum?, targetRed?, targetGreen?, targetBlue?, tragetYellow?, color?, highlightPosition?, vertical?, textOrientation?, textSize?)
下面代碼展示了如何創建堆積函數迷你圖
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);
本站文章除注明轉載外,均為本站原創或翻譯。歡迎任何形式的轉載,但請務必注明出處、不得修改原文相關鏈接,如果存在內容上的異議請郵件反饋至chenjj@fc6vip.cn
文章轉載自: