[{"id":"7720ca38-fc98-4fd8-a3a5-3c0e730c3c72","tags":[{"product":null,"links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c","name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"247ded67-b050-4436-be40-fe7b0eeabef7","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"9a8c377f-1f1e-476e-b487-c2339da9bed3","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"5e8e6db2-89b9-4184-bbdc-301ee676869e","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"e04b598e-b0d8-4054-bdac-5143d90b3d51","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"edb028d0-a8cc-42b2-acda-42a5515729f0","tags":[{"product":null,"links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c","name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"2adde444-20a6-43d7-8896-2b445877327a","tags":[{"product":null,"links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c","name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"6ab8ced2-6c7a-41b6-b861-ba066bd40f40","tags":[{"product":null,"links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c","name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"0c34aedd-80a3-470b-a0f6-c327a4346be7","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"717a5892-fa23-499b-a61d-cff228943aaf","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"bd9be971-69fc-4793-ad6d-234be7a93048","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"a1e8d38f-43d8-4b3e-b747-3fbf7656fcd9","tags":[{"product":null,"links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c","name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"d6995fdf-76ee-421f-9e7a-3fb324d14bbb","tags":[{"product":null,"links":null,"id":"2f522515-8c88-4017-855d-905bc4b0ea3c","name":"Upd","color":"Blue","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"64fa3155-4543-4acd-83b7-f9860fd46673","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"698413bd-0b16-4287-baec-644d98a411d1","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]},{"id":"7e4393a0-21ef-438b-981b-325b64db5baa","tags":[{"product":null,"links":null,"id":"6c1a6899-1b88-404c-9a73-4a0c6c9090a3","name":"New","color":"Red","productId":"66a69675-7df9-45b2-867a-4ab2613535fa"}]}]
        
(Showing Draft Content)

水平軸と垂直軸

折れ線、縦棒、および勝敗スパークラインでは、水平軸を表示したり、垂直方向を指定したりできます。

水平軸を表示するには、 options.displayXAxis プロパティを使用します。水平または垂直の方向を指定するには、dataOrientationメソッドを使用します。データ範囲、または日付軸の範囲を指定できます。折れ線、縦棒、および勝敗スパークラインの数式には、軸または方向を設定するための各種オプションを使用できます。

次の図は、水平および垂直データの範囲、さらに日付軸範囲を示します。水平日付範囲は、水平データ範囲と似ています。


コードの使用

次のサンプルコードは、日付軸を表示します。


activeSheet.setValue(0, 0, "Data Range is A2-A9");
        activeSheet.setValue(1, 0, 1);
        activeSheet.setValue(2, 0, -2);
        activeSheet.setValue(3, 0, -1);
        activeSheet.setValue(4, 0, 6);
        activeSheet.setValue(5, 0, 4);
        activeSheet.setValue(6, 0, -4);
        activeSheet.setValue(7, 0, 3);
        activeSheet.setValue(8, 0, 8);
        activeSheet.setValue(0, 2, "Date axis range is C2-C9");
        activeSheet.setValue(1, 2, '2011/1/5');
        activeSheet.setValue(2, 2, '2011/1/1');
        activeSheet.setValue(3, 2, '2011/2/11');
        activeSheet.setValue(4, 2, '2011/3/1');
        activeSheet.setValue(5, 2, '2011/2/1');
        activeSheet.setValue(6, 2, '2011/2/3');
        activeSheet.setValue(7, 2, '2011/3/6');
        activeSheet.setValue(8, 2, '2011/2/19');

var data = new GC.Spread.Sheets.Range(1, 0, 8, 1);
        var dateAxis = new GC.Spread.Sheets.Range(1, 2, 8, 1);

var setting = new GC.Spread.Sheets.Sparklines.SparklineSetting();
        setting.options.showMarkers = true;
        setting.options.lineWeight = 3;
        setting.options.displayXAxis = true;
        setting.options.showFirst = true;
        setting.options.showLast = true;
        setting.options.showLow = true;
        setting.options.showHigh = true;
        setting.options.showNegative = true;

setting.options.seriesColor = "Text 2 1";
        setting.options.firstMarkerColor = "Text 2 3";
        setting.options.negativeColor = "Accent 2 1";
        setting.options.markersColor = "Accent 3 1";
        setting.options.lowMarkerColor = "Accent 4 1";
        setting.options.highMarkerColor = "Accent 6 1";
        setting.options.lastMarkerColor = "Accent 6 6";
setting.options.axisColor = "Text 1 1";
        activeSheet.addSpan(11, 0, 1, 3, null)
        activeSheet.setText(11, 0, "Sparkline with dateAxis:", null);
        activeSheet.setText(12, 0, "(1) Line", null);
        activeSheet.setText(12, 3, "(2)Column", null);
        activeSheet.setText(12, 6, "(3)Winloss", null);

// 折れ線
activeSheet.addSpan(14, 0, 4, 3, null);
activeSheet.setSparkline(14, 0, data
            , GC.Spread.Sheets.Sparklines.DataOrientation.Vertical
            , GC.Spread.Sheets.Sparklines.SparklineType.line
            , setting
            , dateAxis
            , GC.Spread.Sheets.Sparklines.DataOrientation.Vertical
        );
// 列
activeSheet.addSpan(14, 3, 4, 3, null);
activeSheet.setSparkline(14, 3, data
            , GC.Spread.Sheets.Sparklines.DataOrientation.Vertical
            , GC.Spread.Sheets.Sparklines.SparklineType.column
            , setting
            , dateAxis
            , GC.Spread.Sheets.Sparklines.DataOrientation.Vertical
        );

// 勝敗
activeSheet.addSpan(14, 6, 4, 3, null);
activeSheet.setSparkline(14, 6, data
            , GC.Spread.Sheets.Sparklines.DataOrientation.Vertical
            , GC.Spread.Sheets.Sparklines.SparklineType.winloss
            , setting
            , dateAxis
            , GC.Spread.Sheets.Sparklines.DataOrientation.Vertical
        );

コードの使用

次のサンプルコードは、データ範囲の水平データ(1,2,4,8,6)を使用したスパークラインを作成します。分かりやすく例示するため、図の下には該当数値を表示しています。


activeSheet.setValue(1, 0, 10);
activeSheet.setValue(2, 0, 0);
activeSheet.setValue(3, 0, -3);
activeSheet.setValue(4, 0, -5);
activeSheet.setValue(0, 0, 1);
activeSheet.setValue(0, 1, 2);
activeSheet.setValue(0, 2, 4);
activeSheet.setValue(0, 3, 8);
activeSheet.setValue(0, 4, 6);
activeSheet.setValue(0, 5, new Date(2014, 1, 1));
activeSheet.setValue(1, 5, new Date(2014, 9, 1));
activeSheet.setValue(2, 5, new Date(2014, 7, 1));
activeSheet.setValue(3, 5, new Date(2014, 5, 1));
activeSheet.setValue(4, 5, new Date(2014, 3, 1));
var sparkline = activeSheet.setSparkline(5, 0, new GC.Spread.Sheets.Range(0, 0, 5, 5), GC.Spread.Sheets.Sparklines.DataOrientation.Horizontal, GC.Spread.Sheets.Sparklines.SparklineType.line, new GC.Spread.Sheets.Sparklines.SparklineSetting(), new GC.Spread.Sheets.Range(0, 5, 5, 1), GC.Spread.Sheets.Sparklines.DataOrientation.Vertical);
sparkline.displayDateAxis(false);

コードの使用

次のサンプルコードは、データ範囲の垂直データ(1,10,0,-3,-5)を使用したスパークラインを作成します。分かりやすく例示するため、図の下には該当数値を表示しています。


activeSheet.setValue(1, 0, 10);
activeSheet.setValue(2, 0, 0);
activeSheet.setValue(3, 0, -3);
activeSheet.setValue(4, 0, -5);
activeSheet.setValue(0, 0, 1);
activeSheet.setValue(0, 1, 2);
activeSheet.setValue(0, 2, 4);
activeSheet.setValue(0, 3, 8);
activeSheet.setValue(0, 4, 6);
activeSheet.setValue(0, 5, new Date(2014, 1, 1));
activeSheet.setValue(1, 5, new Date(2014, 9, 1));
activeSheet.setValue(2, 5, new Date(2014, 7, 1));
activeSheet.setValue(3, 5, new Date(2014, 5, 1));
activeSheet.setValue(4, 5, new Date(2014, 3, 1));
var sparkline = activeSheet.setSparkline(5, 0, new GC.Spread.Sheets.Range(0, 0, 5, 5), GC.Spread.Sheets.Sparklines.DataOrientation.Horizontal, GC.Spread.Sheets.Sparklines.SparklineType.line, new GC.Spread.Sheets.Sparklines.SparklineSetting(), new GC.Spread.Sheets.Range(0, 5, 5, 1), GC.Spread.Sheets.Sparklines.DataOrientation.Vertical);
sparkline.displayDateAxis(false);
sparkline.dataOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.Vertical);

コードの使用

次のサンプルコードは、垂直データ(1,10,0,-3,-5)と日付範囲を使用したスパークラインを作成します。分かりやすく例示するため、図内には該当数値を表示しています。


activeSheet.setValue(1, 0, 10);
activeSheet.setValue(2, 0, 0);
activeSheet.setValue(3, 0, -3);
activeSheet.setValue(4, 0, -5);
activeSheet.setValue(0, 0, 1);
activeSheet.setValue(0, 1, 2);
activeSheet.setValue(0, 2, 4);
activeSheet.setValue(0, 3, 8);
activeSheet.setValue(0, 4, 6);
activeSheet.setValue(0, 5, new Date(2014, 1, 1));
activeSheet.setValue(1, 5, new Date(2014, 9, 1));
activeSheet.setValue(2, 5, new Date(2014, 7, 1));
activeSheet.setValue(3, 5, new Date(2014, 5, 1));
activeSheet.setValue(4, 5, new Date(2014, 3, 1));
var sparkline = activeSheet.setSparkline(5, 0, new GC.Spread.Sheets.Range(0, 0, 5, 5), GC.Spread.Sheets.Sparklines.DataOrientation.Horizontal, GC.Spread.Sheets.Sparklines.SparklineType.line, new GC.Spread.Sheets.Sparklines.SparklineSetting(), new GC.Spread.Sheets.Range(0, 5, 5, 1), GC.Spread.Sheets.Sparklines.DataOrientation.Vertical);
 sparkline.dataOrientation(GC.Spread.Sheets.Sparklines.DataOrientation.Vertical);
 sparkline.displayDateAxis(true);