概要と基本的な使い方

タイムスケールはガントシートのガントチャート部分の列ヘッダーであり、表示する期間の時間単位をより小さく、またはより大きな単位で表示することができます。

表示モード タイムスケールのレイアウトには、3つの層(上段、中段、下段)があります。 GC.Spread.Sheets.GanttSheet.TimescaleTierModeを使用してレイアウトを変更できます。 middle middleBottom topMiddleBottom セパレーターを表示する セパレーターを表示すると、上段と中段を区切る線が表示されます。 セパレーターは表示または非表示にできます。 タイムスケールの詳細設定 以下のプロパティで、タイムスケールの上段、中段、下段に表示する内容を設定できます。 unit: GC.Spread.Sheets.GanttSheet.TimescaleUnit count: number labelAlign: "Left" | "Center" | "Right" showTickLines: boolean formatter: string formatterには、"yyyy-mm-dd"のようなSpreadJSの書式文字列や、ガントシートの特殊なキーワード、または書式設定の処理中に実行されるコールバック関数を設定することができます。
/*REPLACE_MARKER*/ /*DO NOT DELETE THESE COMMENTS*/ var myTable; var ganttSheet; var showScaleSeparator = true; var showTopScaleTick = true; var showMiddleScaleTick = true; var showBottomScaleTick = true; var supposedFormats = [ undefined, [ { value:`yyyy"年"`, info: `2009年, 2010年,... `}, { value:`yyyy`, info: `2009, 2010,... `}, { value:`'yy`, info: `'09, '10, ...`}, { value:`yy`, info: `09, 10,...`}, { value:`"第"{!YEAR_FROM_START}"年"`, info: `第1年, 第2年 ... (開始から)`}, { value:`"Y"{!YEAR_FROM_START}`, info: `Y1, Y2, Y3, ... (開始から)`}, { value:`{!YEAR_FROM_START}`, info: `1, 2, 3, 4, ... (開始から)`}, { value:`"第"{!YEAR_FROM_END}"年"`, info: `第2年, 第1年... (終了から)`}, { value:`"Y" {!YEAR_FROM_END}`, info: `Y3, Y2, Y1, ... (終了から)`}, { value:`{!YEAR_FROM_END}`, info: `4, 3, 2, 1, ... (終了から)`}, ], [ { value: `{!HALF_YEAR("前期","後期")}`, info: `前期, 後期, ... `}, { value: `yyyy, {!HALF_YEAR("上半期","下半期")}`, info: `2009, 上半期, 2009, 下半期, ...`}, { value: `yyyy, {!HALF_YEAR("上期","下期")}`, info: `2009, 上期, 2009, 下期, ...`}, { value: `{!HALF_YEAR("上半期","下半期")}`, info: `上半期, 下半期, ...`}, { value: `{!HALF_YEAR("上期","下期")}`, info: `上期, 下期, ...`}, { value: `'yy "H" {!HALF_YEAR("1","2")}`, info: `'09 H1, '09 H2, ...`}, { value: `"H" {!HALF_YEAR("1","2")}`, info: `H1, H2, ...`}, { value: `{!HALF_YEAR("1","2")}`, info: `1, 2,…`}, { value: `{!HALF_YEAR("1","2")}"H"yy`, info: `1H09, 2H09, ...`}, { value: `"半期" {!HALF_YEAR_FROM_START}`, info: `半期 1, 半期 2, 半期 3, ... (開始から)`}, { value: `"H" {!HALF_YEAR_FROM_START}`, info: `H1, H2, H3, ... (開始から)`}, { value: `{!HALF_YEAR_FROM_START}`, info: `1, 2, 3, ... (開始から)`}, { value: `"半期" {!HALF_YEAR_FROM_END}`, info: `半期 3, 半期 2, 半期 1, ... (終了から)`}, { value: `"H"{!HALF_YEAR_FROM_END}`, info: `H3, H2, H1, ... (終了から)`}, { value: `{!HALF_YEAR_FROM_END}`, info: `3, 2, 1, ... (終了から)`}, ], [ { value: `"第"{!QUARTER("1","2","3","4")}"四半期"`, info: `第1四半期`}, { value: `yyyy "第"{!QUARTER("1","2","3","4")}"四半期"`, info: `2009 第1四半期`}, { value: `"Qtr" {!QUARTER("1","2","3","4")}`, info: `Qtr 1, Qtr 2, ...`}, { value: `'yy "Q"{!QUARTER("1","2","3","4")}`, info: `'09 Q1, '09 Q2, ...`}, { value: `"Q"{!QUARTER("1","2","3","4")}`, info: `Q1, Q2, ...`}, { value: `{!QUARTER("1","2","3","4")}`, info: `1, 2, ...`}, { value: `{!QUARTER("1","2","3","4")}"Q"yy`, info: `1Q09, 2Q09, ...`}, { value: `"第"{!QUARTER_FROM_START}"四半期"`, info: `第1四半期, 第2四半期, ... (開始から)`}, { value: `"Q"{!QUARTER_FROM_START}`, info: `Q1, Q2, Q3, Q4, ... (開始から)`}, { value: `{!QUARTER_FROM_START}`, info: `1, 2, 3, 4, ... (開始から)`}, { value: `"第"{!QUARTER_FROM_END}"四半期"`, info: `第2四半期, 第1四半期, ... (終了から)`}, { value: `"Q"{!QUARTER_FROM_END}`, info: `Q4, Q3, Q2, Q1, ... (終了から)`}, { value: `{!QUARTER_FROM_END}`, info: `4, 3, 2, 1, ... (終了から)`}, ], [ { value: `yyyy mmmmm`, info: `2009 1月`}, { value: `yy mmmm`, info: `'09 1月`}, { value: `mmmm`, info: `1月`}, { value: `[$-409]yy mmm`, info: `09 Jan`}, { value: `[$-409]mmm`, info: `Jan`}, { value: `m`, info: `1, 2,...`}, { value: `'yy m`, info: `'09 1`}, { value: `yy/m`, info: `09/1`}, { value: `"第"{!MONTH_FROM_START}"月"`, info: `第1月, 第2月, ... (開始から)`}, { value: `"M" {!MONTH_FROM_START}`, info: `M1, M2, M3, ... (開始から)`}, { value: `{!MONTH_FROM_START}`, info: `1, 2, 3, 4, ... (開始から)`}, { value: `"第"{!MONTH_FROM_END}"月"`, info: `第2月, 第1月, ... (終了から)`}, { value: `"M"{!MONTH_FROM_END}`, info: `M3, M2, M1, ... (終了から)`}, { value: `{!MONTH_FROM_END}`, info: `4, 3, 2, 1, ... (終了から)`}, ], [ { value: `d`, info: `1, 11, 21, ... `}, { value: `{!THIRDS_OF_MONTH("B","M","E")}`, info: `B, M, E,..`}, { value: `{!THIRDS_OF_MONTH("上旬","中旬","下旬")}`, info: `上旬, 中旬, 下旬, ...`}, { value: `m/d`, info: `1/1, 1/11, 1/21, ...`}, { value: `m/{!THIRDS_OF_MONTH("B","M","E")}`, info: `1/B, 1/M, 1/E, ...`}, { value: `mmmm{!THIRDS_OF_MONTH("上旬","中旬","下旬")}`, info: `1月上旬, 1月中旬, ...`}, { value: `[$-409]mmm d`, info: `Jan 1, Jan 11, Jan 21, ...`}, { value: `[$-409]mmm {!THIRDS_OF_MONTH("B","M","E")}`, info: `Jan B. Jan M, Jan E, ...`}, { value: `mmmm d`, info: `1月 1, 1月 11, 1月 21, ...`}, { value: `yy/m/d`, info: `09/1/1, 09/1/11, 09/1/21, ...`}, { value: `yy/m/{!THIRDS_OF_MONTH("B","M","E")}`, info: `09/1/B, 09/1/M, 09/1/E, ...`}, { value: `[$-409]'yy mmm d`, info: `'09 Jan 1, '09 Jan 11, '09 Jan 21, ...`}, { value: `[$-409]'yy mmm {!THIRDS_OF_MONTH("B","M","E")}`, info: `'09 Jan B, '09 Jan M, '09 Jan E, ...`}, { value: `yyyy mmmm d`, info: `2009 1月 1, 2009 1月 11, ...`}, { value: `yyyy mmmm {!THIRDS_OF_MONTH("上旬","中旬","下旬")}`, info: `2009 1月 上旬, ...`}, ], [ { value: `yyyy"年"m"月"d"日"(dddd)`, info: `2009年1月25日(日曜日)`}, { value: `yyyy"年"m"月"d"日"`, info: `2009年1月25日`}, { value: `yyyy/m/d(ddd)`, info: `2009/1/25(日)`}, { value: `yyyy/m/d`, info: `2009/1/25`}, { value: `[$-409]'yy mmm d`, info: `'09 Jan 25`}, { value: `m"月"d"日"(dddd)`, info: `1月25日(日曜日)`}, { value: `m"月"d"日"(ddd)`, info: `1月25日(日)`}, { value: `m"月"d"日"`, info: `1月25日`}, { value: `m/d(dddd)`, info: `1/25(日曜日)`}, { value: `m/d(ddd)`, info: `1/25(日)`}, { value: `m/d`, info: `1/25`}, { value: `[$-409]mmm d`, info: `Jan 25, Feb 1,...`}, { value: `yy/m/d`, info: `09/1/25, 09/2/1, ...`}, { value: `m/d`, info: `1/25, 2/1, ...`}, { value: `d`, info: `25, 1, ...`}, { value: `dddd dd`, info: `日曜日 25`}, { value: `dddd {!WEEK_OF_YEAR}`, info: `日曜日 1, ... 日曜日 52, ...`}, { value: `{!WEEK_OF_YEAR}`, info: `1, 2, ... 52, 1, 2, ...`}, { value: `"第"{!WEEK_FROM_START}"週"`, info: `第1週, 第2週, ... (開始から)`}, { value: `"W"{!WEEK_FROM_START}`, info: `W1, W2, W3, W4, ... (開始から)`}, { value: `{!WEEK_FROM_START}`, info: `1, 2, 3, 4, ... (開始から)`}, { value: `"第"{!WEEK_FROM_END}"週"`, info: `第2週, 第1週, ... (終了から)`}, { value: `"W"{!WEEK_FROM_END}`, info: `W4, W3, W2, W1, ... (終了から)`}, { value: `{!WEEK_FROM_END}`, info: `4, 3, 2, 1, ...(終了から)`}, ], [ { value: `yyyy"年"m"月"d"日"(dddd)`, info :`2009年1月28日(水曜日)`}, { value: `yyyy"年"m"月"d"日"`, info :`2009年1月28日`}, { value: `yyyy/m/d(ddd)`, info :`2009/1/28(水)`}, { value: `yyyy/m/d`, info :`2009/1/28`}, { value: `m"月"d"日"(dddd)`, info :`1月28日(水曜日)`}, { value: `m"月"d"日"(ddd)`, info :`1月28日(水)`}, { value: `m"月"d"日"`, info :`1月28日`}, { value: `m/d(ddd)`, info :`1/28(水)`}, { value: `m/d`, info :`1/28`}, { value: `[$-409]yy mmm d`, info :`09 Jan 28, 09 Jan 29, ...`}, { value: `yy/m/d`, info :`09/1/28, 09/1/29, ...`}, { value: `[$-409]mmm d`, info :`Jan 28, Jan 29, ...`}, { value: `dddd`, info :`日曜日, 月曜日, ...`}, { value: `ddd`, info :`日, 月, ...`}, { value: `[$-409]ddd`, info :`Sun, Mon,Tue, ...`}, { value: `d`, info :`1, 2, ... `}, { value: `yyyy"年第"{!DAY_OF_YEAR}"日"`, info :`2009年第128日(Day of Year)`}, { value: `yy"年第"{!DAY_OF_YEAR}"日"`, info :`09年第128日(Day of Year)`}, { value: `{!DAY_OF_YEAR}`, info :`128 (Day of Year)`}, { value: `"第"{!DAY_FROM_START}"日"`, info :`第1日, 第2日 ... (開始から)`}, { value: `"D" {!DAY_FROM_START}`, info :`D1, D2, D3, ... (開始から)`}, { value: `{!DAY_FROM_START}`, info :`1, 2, 3, 4, ... (開始から)`}, { value: `"第"{!DAY_FROM_END}"日"`, info :`第2日, 第1日, ... (終了から) `}, { value: `"D" {!DAY_FROM_END}`, info :`D3, D2, D1, ... (終了から)`}, { value: `{!DAY_FROM_END}`, info :`4, 3, 2, 1, ... (終了から)`}, ], [ { value: `m"月"d"日", h`, info: `1月28日, 11`}, { value: `[$-409]mmm d, h`, info: `Jan 28, 11`}, { value: `m/d h`, info: `1/28 11`}, { value: `h:mm`, info: `11:00, 12:00, ...`}, { value: `h`, info: `11, 12, ...`}, { value: `hh`, info: `11, 12, ...`}, { value: `"第"{!HOUR_FROM_START}時間`, info: `第1時間, 第2時間, ... (開始から)`}, { value: `"H"{!HOUR_FROM_START}`, info: `H1, H2, H3, ... (開始から)`}, { value: `{!HOUR_FROM_START}`, info: `1, 2, 3, 4, ... (開始から)`}, { value: `"第"{!HOUR_FROM_END}時間`, info: `第2時間, 第1時間, ... (終了から)`}, { value: `"H"{!HOUR_FROM_END}`, info: `H3, H2, H1, ... (終了から)`}, { value: `{!HOUR_FROM_END}`, info: `4, 3, 2, 1, ... (終了から)`}, ], [ { value: `hh:mm`, info: `13:45, 13:46, ... `}, { value: `{!Minute}`, info: `45, 46, 47, ..`}, { value: `"第"{!Minute_FROM_START}"分"`, info: `第1分, 第2分, ... (開始から)`}, { value: `"M"{!Minute_FROM_START}`, info: `M1, M2, M3, ... (開始から)`}, { value: `{!Minute_FROM_START}`, info: `1, 2, 3, 4, ... (開始から)`}, { value: `"第"{!Minute_FROM_END}"分"`, info: `第2分, 第1分, ... (終了から)`}, { value: `"M"{!Minute_FROM_END}`, info: `M3, M2, M1, ... (終了から)`}, { value: `{!Minute_FROM_END}`, info: `4, 3, 2, 1, ... (終了から)`}, ] ]; window.onload = function() { var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"), { sheetCount: 0 }); initSpread(spread); initSplitView(spread); }; function initSpread(spread) { spread.suspendPaint(); initDataSource(spread); initGanttSheet(spread); spread.resumePaint(); } function initDataSource(spread) { var tableName = "Gantt_Id"; var baseApiUrl = getBaseApiUrl(); var apiUrl = baseApiUrl + "/" + tableName; var dataManager = spread.dataManager(); myTable = dataManager.addTable("myTable", { batch: true, remote: { read: { url: apiUrl } }, schema: { hierarchy: { type: "Parent", column: "parentId" }, columns: { id: { isPrimaryKey: true }, taskNumber: { dataType: "rowOrder" } } } }); } function initGanttSheet(spread) { ganttSheet = spread.addSheetTab(0, "GanttSheet", GC.Spread.Sheets.SheetType.ganttSheet); var view = myTable.addView("ganttView", [ { value: "taskNumber", caption: "NO.", width: 60 }, { value: "name", caption: "Task Name", width: 200 }, { value: "duration", caption: "Duration", width: 90 }, { value: "predecessors", caption: "Predecessors", width: 120 } ]); view.fetch().then(function() { ganttSheet.bindGanttView(view); }); initSidePanel(ganttSheet); } function initSidePanel(ganttSheet) { var topScalePanel = document.getElementById("top-scale-panel"); var middleScalePanel = document.getElementById("middle-scale-panel"); var bottomScalePanel = document.getElementById("bottom-scale-panel"); var timescaleModeItem = document.getElementById("timescale-mode"); var scaleSeparatorItem = document.getElementById("scale-separator"); var topScaleUnitItem = document.getElementById("top-scale-unit"); var topScaleCountItem = document.getElementById("top-scale-count"); var topScaleAlignItem = document.getElementById("top-scale-align"); var topScaleFormatItem = document.getElementById("top-scale-format"); var topScaleTickItem = document.getElementById("top-scale-tick"); var middleScaleUnitItem = document.getElementById("middle-scale-unit"); var middleScaleCountItem = document.getElementById("middle-scale-count"); var middleScaleAlignItem = document.getElementById("middle-scale-align"); var middleScaleFormatItem = document.getElementById("middle-scale-format"); var middleScaleTickItem = document.getElementById("middle-scale-tick"); var bottomScaleUnitItem = document.getElementById("bottom-scale-unit"); var bottomScaleCountItem = document.getElementById("bottom-scale-count"); var bottomScaleAlignItem = document.getElementById("bottom-scale-align"); var bottomScaleFormatItem = document.getElementById("bottom-scale-format"); var bottomScaleTickItem = document.getElementById("bottom-scale-tick"); var setScaleItem = document.getElementById("set-scale"); syncOptionToPanel(true); timescaleModeItem.addEventListener("change", function() { var mode = Number(timescaleModeItem.value); if (mode === 1) { topScalePanel.classList.add("hide"); middleScalePanel.classList.remove("hide"); bottomScalePanel.classList.add("hide"); } else if (mode === 2) { topScalePanel.classList.add("hide"); middleScalePanel.classList.remove("hide"); bottomScalePanel.classList.remove("hide"); } else if (mode === 3) { topScalePanel.classList.remove("hide"); middleScalePanel.classList.remove("hide"); bottomScalePanel.classList.remove("hide"); } syncOptionToPanel(); }); scaleSeparatorItem.addEventListener("click", function() { toggleScaleSeparator(); }); topScaleTickItem.addEventListener("click", function() { toggleTopScaleTick(); }); middleScaleTickItem.addEventListener("click", function() { toggleMiddleScaleTick(); }); bottomScaleTickItem.addEventListener("click", function() { toggleBottomScaleTick(); }); topScaleUnitItem.addEventListener("change", function() { syncTopScaleFormatOptions(); }); middleScaleUnitItem.addEventListener("change", function() { syncMiddleScaleFormatOptions(); }); bottomScaleUnitItem.addEventListener("change", function() { syncBottomScaleFormatOptions(); }); setScaleItem.addEventListener("click", function() { var mode = Number(timescaleModeItem.value); var timescale = ganttSheet.project.timescale; var unit, formatter; ganttSheet.suspendPaint(); timescale.tierMode = Number(mode); timescale.showScaleSeparator = showScaleSeparator; if (mode === 1 || mode === 2 || mode === 3) { unit = Number(middleScaleUnitItem.value); formatter = middleScaleFormatItem.value ? middleScaleFormatItem.value : undefined; timescale.middleTier.unit = unit; timescale.middleTier.count = Number(middleScaleCountItem.value); timescale.middleTier.labelAlign = middleScaleAlignItem.value; if (formatter) { timescale.middleTier.formatter = supposedFormats[unit] ? supposedFormats[unit][formatter].value : undefined; } else { timescale.middleTier.formatter = undefined; } timescale.middleTier.showTickLines = showMiddleScaleTick; } if (mode === 2 || mode === 3) { unit = Number(bottomScaleUnitItem.value); formatter = bottomScaleFormatItem.value ? bottomScaleFormatItem.value : undefined; timescale.bottomTier.unit = unit; timescale.bottomTier.count = Number(bottomScaleCountItem.value); timescale.bottomTier.labelAlign = bottomScaleAlignItem.value; if (formatter) { timescale.bottomTier.formatter = supposedFormats[unit] ? supposedFormats[unit][formatter].value : undefined; } else { timescale.bottomTier.formatter = undefined; } timescale.bottomTier.showTickLines = showBottomScaleTick; } if (mode === 3) { unit = Number(topScaleUnitItem.value); formatter = topScaleFormatItem.value ? topScaleFormatItem.value : undefined; timescale.topTier.unit = unit; timescale.topTier.count = Number(topScaleCountItem.value); timescale.topTier.labelAlign = topScaleAlignItem.value; if (formatter) { timescale.topTier.formatter = supposedFormats[unit] ? supposedFormats[unit][formatter].value : undefined; } else { timescale.topTier.formatter = undefined; } timescale.topTier.showTickLines = showTopScaleTick; } ganttSheet.resumePaint(); }); function toggleScaleSeparator() { if (scaleSeparatorItem.classList.contains("active")) { showScaleSeparator = false; scaleSeparatorItem.classList.remove("active"); } else { showScaleSeparator = true; scaleSeparatorItem.classList.add("active"); } } function toggleTopScaleTick() { if (topScaleTickItem.classList.contains("active")) { showTopScaleTick = false; topScaleTickItem.classList.remove("active"); } else { showTopScaleTick = true; topScaleTickItem.classList.add("active"); } } function toggleMiddleScaleTick() { if (middleScaleTickItem.classList.contains("active")) { showMiddleScaleTick = false; middleScaleTickItem.classList.remove("active"); } else { showMiddleScaleTick = true; middleScaleTickItem.classList.add("active"); } } function toggleBottomScaleTick() { if (bottomScaleTickItem.classList.contains("active")) { showBottomScaleTick = false; bottomScaleTickItem.classList.remove("active"); } else { showBottomScaleTick = true; bottomScaleTickItem.classList.add("active"); } } function syncTopScaleFormatOptions() { var unit = topScaleUnitItem.value; var formatListItem = createFormatOptionList(unit); topScaleFormatItem.innerHTML = formatListItem; topScaleFormatItem.value = ""; } function syncMiddleScaleFormatOptions() { var unit = middleScaleUnitItem.value; var formatListItem = createFormatOptionList(unit); middleScaleFormatItem.innerHTML = formatListItem; middleScaleFormatItem.value = ""; } function syncBottomScaleFormatOptions() { var unit = bottomScaleUnitItem.value; var formatListItem = createFormatOptionList(unit); bottomScaleFormatItem.innerHTML = formatListItem; bottomScaleFormatItem.value = ""; } function syncOptionToPanel(includeMode) { var timescale = ganttSheet.project.timescale; var tierMode = Number(timescaleModeItem.value); if (includeMode) { timescaleModeItem.value = tierMode; if (showScaleSeparator !== timescale.showScaleSeparator) { toggleScaleSeparator(); } } if (tierMode === 1 || tierMode === 2 || tierMode === 3) { middleScaleUnitItem.value = timescale.middleTier.unit; syncMiddleScaleFormatOptions(); middleScaleCountItem.value = timescale.middleTier.count; middleScaleAlignItem.value = timescale.middleTier.labelAlign; middleScaleFormatItem.value = timescale.middleTier.formatter ? timescale.middleTier.formatter : ""; if (showMiddleScaleTick !== timescale.middleTier.showTickLines) { toggleMiddleScaleTick(); } } if (tierMode === 2 || tierMode === 3) { bottomScaleUnitItem.value = timescale.bottomTier.unit; syncBottomScaleFormatOptions(); bottomScaleCountItem.value = timescale.bottomTier.count; bottomScaleAlignItem.value = timescale.bottomTier.labelAlign; bottomScaleFormatItem.value = timescale.bottomTier.formatter ? timescale.bottomTier.formatter : ""; if (showBottomScaleTick !== timescale.bottomTier.showTickLines) { toggleBottomScaleTick(); } } if (tierMode === 3) { topScaleUnitItem.value = timescale.topTier.unit; syncTopScaleFormatOptions(); topScaleCountItem.value = timescale.topTier.count; topScaleAlignItem.value = timescale.topTier.labelAlign; topScaleFormatItem.value = timescale.topTier.formatter ? timescale.topTier.formatter : ""; if (showTopScaleTick !== timescale.topTier.showTickLines) { toggleTopScaleTick(); } } } } function createFormatOptionList(target) { var formats = supposedFormats[target]; var options = `<option value="">None</option>`; for (let i = 0; i < formats.length; i ++) { var format = formats[i]; options += `<option value="${i}">${format.info}</option>`; } return options; } function getBaseApiUrl() { return window.location.href.match(/http.+spreadjs\/demos\//)[0] + 'server/api'; } function initSplitView(spread) { var host = document.getElementById("split-view"); var content = host.getElementsByClassName("split-content")[0]; var panel = host.getElementsByClassName("split-panel")[0]; new SplitView({ host: host, content: content, panel: panel, refreshContent: function() { spread.refresh(); } }); }
<!doctype html> <html style="height:100%;font-size:14px;"> <head> <meta charset="utf-8" /> <meta name="spreadjs culture" content="ja-jp" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" type="text/css" href="$DEMOROOT$/ja/purejs/node_modules/@mescius/spread-sheets/styles/gc.spread.sheets.excel2013white.css"> <link rel="stylesheet" type="text/css" href="$DEMOROOT$/spread/source/splitView/splitView.css"> <!-- Promise Polyfill for IE, https://www.npmjs.com/package/promise-polyfill --> <script src="https://cdn.jsdelivr.net/npm/promise-polyfill@8/dist/polyfill.min.js"></script> <script src="$DEMOROOT$/ja/purejs/node_modules/@mescius/spread-sheets/dist/gc.spread.sheets.all.min.js" type="text/javascript"></script> <script src="$DEMOROOT$/ja/purejs/node_modules/@mescius/spread-sheets-tablesheet/dist/gc.spread.sheets.tablesheet.min.js" type="text/javascript"></script> <script src="$DEMOROOT$/ja/purejs/node_modules/@mescius/spread-sheets-ganttsheet/dist/gc.spread.sheets.ganttsheet.min.js" type="text/javascript"></script> <script src="$DEMOROOT$/ja/purejs/node_modules/@mescius/spread-sheets-resources-ja/dist/gc.spread.sheets.resources.ja.min.js" type="text/javascript"></script> <script src="$DEMOROOT$/spread/source/splitView/splitView.js" type="text/javascript"></script> <script src="$DEMOROOT$/spread/source/js/license.js" type="text/javascript"></script> <script src="app.js" type="text/javascript"></script> <link rel="stylesheet" type="text/css" href="styles.css"> </head> <body> <div id="split-view" class="sample-tutorial"> <div id="ss" class="sample-spreadsheets split-content"></div> <div class="options-container split-panel"> <div class="option-row option-title"> タイムスケールの設定 </div> <div class="option-block"> <div class="option-row selection-box"> <label for="timescale-mode">モード</label> <select id="timescale-mode"> <option value="1">一層(中段)</option> <option value="2" selected>二層(中段、下段)</option> <option value="3">三層(上段、中段、下段)</option> </select> </div> <div class="option-row"> <label class="option-checkbox active" id="scale-separator">セパレーターを表示</label> <div class="option-info">* セパレーターを表示するかどうかを切り替える</div> </div> </div> <div class="option-block hide" id="top-scale-panel"> <div class="option-info toggle">* モードによってパネルは変化します</div> <div class="option-row option-title"> 上段の設定 </div> <div class="option-row selection-box"> <label for="top-scale-unit">単位</label> <select id="top-scale-unit"> <option value="1">年</option> <option value="2">半期</option> <option value="3">四半期</option> <option value="4">月</option> <option value="5">旬</option> <option value="6">週</option> <option value="7">日</option> <option value="8">時間</option> <option value="9">分</option> </select> </div> <div class="option-row input-box"> <label for="top-scale-count">カウント</label> <input type="text" id="top-scale-count" value="1" /> <div class="option-info valid">* 有効値: 整数値</div> </div> <div class="option-row selection-box"> <label for="top-scale-align">水平位置</label> <select id="top-scale-align"> <option value="Left">左揃え</option> <option value="Center">中央揃え</option> <option value="Right">右揃え</option> </select> </div> <div class="option-row selection-box"> <label for="top-scale-format">書式</label> <select id="top-scale-format"> <option value="">なし</option> </select> </div> <div class="option-row"> <label class="option-checkbox active" id="top-scale-tick">目盛り線</label> <div class="option-info">* 目盛り線を表示するかどうかを切り替える</div> </div> </div> <div class="option-block" id="middle-scale-panel"> <div class="option-info toggle">* モードによってパネルは変化します</div> <div class="option-row option-title"> 中段の設定 </div> <div class="option-row selection-box"> <label for="middle-scale-unit">単位</label> <select id="middle-scale-unit"> <option value="1">年</option> <option value="2">半期</option> <option value="3">四半期</option> <option value="4">月</option> <option value="5">旬</option> <option value="6">週</option> <option value="7">日</option> <option value="8">時間</option> <option value="9">分</option> </select> </div> <div class="option-row input-box"> <label for="middle-scale-count">カウント</label> <input type="text" id="middle-scale-count" value="1" /> <div class="option-info valid">* 有効値: 整数値</div> </div> <div class="option-row selection-box"> <label for="middle-scale-align">水平位置</label> <select id="middle-scale-align"> <option value="Left">左揃え</option> <option value="Center">中央揃え</option> <option value="Right">右揃え</option> </select> </div> <div class="option-row selection-box"> <label for="middle-scale-format">書式</label> <select id="middle-scale-format"> <option value="">なし</option> </select> </div> <div class="option-row"> <label class="option-checkbox active" id="middle-scale-tick">目盛り線</label> <div class="option-info">* 目盛り線を表示するかどうかを切り替える</div> </div> </div> <div class="option-block" id="bottom-scale-panel"> <div class="option-info toggle">* モードによってパネルは変化します</div> <div class="option-row option-title"> 下段の設定 </div> <div class="option-row selection-box"> <label for="bottom-scale-unit">単位</label> <select id="bottom-scale-unit"> <option value="1">年</option> <option value="2">半期</option> <option value="3">四半期</option> <option value="4">月</option> <option value="5">旬</option> <option value="6">週</option> <option value="7">日</option> <option value="8">時間</option> <option value="9">分</option> </select> </div> <div class="option-row input-box"> <label for="bottom-scale-count">カウント</label> <input type="text" id="bottom-scale-count" value="1" /> <div class="option-info valid">* 有効値: 整数値</div> </div> <div class="option-row selection-box"> <label for="bottom-scale-align">水平位置</label> <select id="bottom-scale-align"> <option value="Left">左揃え</option> <option value="Center">中央揃え</option> <option value="Right">右揃え</option> </select> </div> <div class="option-row selection-box"> <label for="bottom-scale-format">書式</label> <select id="bottom-scale-format"> <option value="">なし</option> </select> </div> <div class="option-row"> <label class="option-checkbox active" id="bottom-scale-tick">目盛り線</label> <div class="option-info">* 目盛り線を表示するかどうかを切り替える</div> </div> </div> <input type="button" id="set-scale" class="option-button" value="タイムスケールを設定する"> </div> </div> </html>
.option-block { background: #fff; padding: 8px; margin: 12px 0; border-radius: 4px; border: 1px dashed #82bc00; box-shadow: 0px 0 6px 0 rgba(0,0,0,0.1); } .option-block.toggle { border: 1px dotted #f7a711; } .option-row { font-size: 14px; box-sizing: border-box; padding: 4px 0; } .option-title { font-weight: bold; color: #656565; } .option-info { font-size: 12px; color: #919191; margin-top: 6px; font-weight: normal; } .option-info.valid { color: #82bc00; } .option-info.toggle { color: #f7a711; } .option-button { width: 100%; padding: 0; line-height: 20px; background: #82bc00; color: #fff; transition: 0.3s; cursor: pointer; outline: none; border-radius: 4px; box-sizing: border-box; box-shadow: 0 1px 4px 0 rgba(0,0,0,0.3); border: none; } .option-button:hover { background: #82bc00; color: #fff; box-shadow: 0 3px 8px 0 rgba(0,0,0,0.4); } .option-checkbox { background: #fff; border: 1px dashed #f7a711; color: #f7a711; padding: 2px 4px; transition: 0.3s; box-sizing: border-box; cursor: pointer; } .option-checkbox.active { color: #fff; background: #f7a711; box-shadow: 0 1px 4px 0 rgba(0,0,0,0.3); border-radius: 4px; } .selection-box { position: relative; } .selection-box > select { text-align: left; width: 100%; height: 20px; padding: 0; line-height: 20px; background: transparent; border: none; border-bottom: 2px solid #656565; color: #656565; transition: 0.3s; cursor: pointer; outline: none; box-sizing: border-box; } .selection-box > select > option { background: white; } .selection-box > select:focus { border-bottom: 2px solid #82bc00; color: #82bc00; box-shadow: 0 2px 6px 0 rgba(0,0,0,0.3); } .selection-box > label { position: absolute; cursor: pointer; font-size: 12px; color: #fff; background: #656565; padding: 0 4px; right: 0; top: 6px; box-shadow: 0 1px 4px 0 rgba(0,0,0,0.3); } .input-box { position: relative; } .input-box > input[type=text] { width: 100%; background: transparent; border: none; color: #656565; border-bottom: 2px solid #656565; outline: none; box-sizing: border-box; transition: 0.3s; } .input-box > input[type=text]:focus { color: #82bc00; border-bottom: 2px solid #82bc00; } .input-box > label { cursor: pointer; position: absolute; right: 0; top: 5px; font-size: 12px; color: #fff; background: #656565; padding: 0 4px; box-shadow: 0 1px 4px 0 rgba(0,0,0,0.3); }