非稼働時間

ガントシートのチャート領域の、非稼働時間のスタイルを変更することができます。

描画モード 2種類の描画モード(GC.Spread.Sheets.GanttSheet.NonWorkingTimeDrawMode)があります。 Behind None 色 非稼働時間の塗りつぶし色を変更できます。 塗りつぶしパターン 非稼働時間にはいくつかの塗りつぶしパターン(GC.Spread.Sheets.GanttSheet.TaskbarFillPattern)があります。 darkFill dashedBorder diagonalCross diagonalLeft diagonalRight hollow lightFill lineCross lineHorizontal lineVertical mediumFill solidFill
/*REPLACE_MARKER*/ /*DO NOT DELETE THESE COMMENTS*/ <template> <div id="split-view" class="sample-tutorial"> <gc-spread-sheets class="sample-spreadsheets split-content" @workbookInitialized="initSpread"> </gc-spread-sheets> <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="draw-mode">描画モード</label> <select id="draw-mode"> <option value="Behind" selected="selected">Behind</option> <option value="None">None</option> </select> </div> <div class="option-row input-box"> <label for="color">色</label> <input type="text" id="color" value="#F7F7F7" /> <div class="option-info valid">* 有効値: カラーの文字列</div> </div> <div class="option-row selection-box"> <label for="pattern">塗りつぶしパターン</label> <select id="pattern"> <option value="darkFill">darkFill</option> <option value="dashedBorder">dashedBorder</option> <option value="diagonalCross">diagonalCross</option> <option value="diagonalLeft">diagonalLeft</option> <option value="diagonalRight">diagonalRight</option> <option value="hollow">hollow</option> <option value="lightFill">lightFill</option> <option value="lineCross">lineCross</option> <option value="lineHorizontal">lineHorizontal</option> <option value="lineVertical">lineVertical</option> <option value="mediumFill">mediumFill</option> <option value="solidFill" selected>solidFill</option> </select> </div> </div> <div class="option-row"> <input type="button" id="set-style" class="option-button" value="スタイルを設定する" @click="setStyle()" /> </div> </div> </div> </template> <script setup> import GC from "@mescius/spread-sheets"; import { ref } from "vue"; import "@mescius/spread-sheets-tablesheet"; import "@mescius/spread-sheets-ganttsheet"; import '@mescius/spread-sheets-resources-ja'; GC.Spread.Common.CultureManager.culture("ja-jp"); import "@mescius/spread-sheets-vue"; const spreadRef = ref(null); let myTable = null; let ganttSheet = null; let spread = null; function initSpread(spread) { spreadRef.value = spread; spread.suspendPaint(); spread.clearSheets(); initDataSource(spread); initGanttSheet(spread); spread.resumePaint(); initSplitView(spread); }; 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, visible: false } ]); view.fetch().then(function () { ganttSheet.bindGanttView(view); }).then(function () { ganttSheet.project.timescale.nonWorkingTime.color = "#bed7ee"; ganttSheet.project.timescale.nonWorkingTime.pattern = "lineCross"; }); }; function setStyle() { var drawModeOption = document.getElementById("draw-mode"); var colorOption = document.getElementById("color"); var patternOption = document.getElementById("pattern"); var drawMode = drawModeOption.value; var color = colorOption.value; var pattern = patternOption.value; var nonWorkingTime = ganttSheet.project.timescale.nonWorkingTime; nonWorkingTime.drawMode = drawMode; if (color) { nonWorkingTime.color = color; } nonWorkingTime.pattern = pattern; } 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(); } }); } function getBaseApiUrl() { return window.location.href.match(/http.+spreadjs\/demos\//)[0] + 'server/api'; } </script> <style scoped> #app { height: 100%; } .sample-tutorial { position: relative; height: 100%; overflow: hidden; } .sample-spreadsheets { width: 100%; height: 100%; overflow: hidden; float: left; } body { position: absolute; top: 0; bottom: 0; left: 0; right: 0; } .options-container { float: right; width: 280px; padding: 12px; height: 100%; box-sizing: border-box; background: #fbfbfb; overflow: auto; box-shadow: inset 0px 0 4px 0 rgba(0, 0, 0, 0.4); } .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); } </style>
<!DOCTYPE html> <html lang="en" style="height:100%;font-size:14px;"> <head> <meta charset="utf-8" /> <meta http-equiv="X-UA-Compatible" content="IE=edge" /> <title>SpreadJS VUE</title> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" type="text/css" href="$DEMOROOT$/ja/vue3/node_modules/@mescius/spread-sheets/styles/gc.spread.sheets.excel2013white.css"> <link rel="stylesheet" type="text/css" href="$DEMOROOT$/spread/source/splitView/splitView.css"> <script src="$DEMOROOT$/ja/vue3/node_modules/systemjs/dist/system.src.js"></script> <script src="./systemjs.config.js"></script> <script src="./compiler.js" type="module"></script> <script src="$DEMOROOT$/spread/source/splitView/SplitView.js"></script> <script> var System = SystemJS; System.import("./src/app.js"); System.import('$DEMOROOT$/ja/lib/vue3/license.js'); </script> </head> <body> <div id="app"></div> </body> </html>
(function (global) { SystemJS.config({ transpiler: 'plugin-babel', babelOptions: { es2015: true }, paths: { // paths serve as alias 'npm:': 'node_modules/' }, packageConfigPaths: [ './node_modules/*/package.json', "./node_modules/@mescius/*/package.json", "./node_modules/@babel/*/package.json", "./node_modules/@vue/*/package.json" ], map: { 'vue': "npm:vue/dist/vue.esm-browser.js", 'tiny-emitter': 'npm:tiny-emitter/index.js', 'plugin-babel': 'npm:systemjs-plugin-babel/plugin-babel.js', "systemjs-babel-build": "npm:systemjs-plugin-babel/systemjs-babel-browser.js", '@mescius/spread-sheets': 'npm:@mescius/spread-sheets/index.js', '@mescius/spread-sheets-resources-ja': 'npm:@mescius/spread-sheets-resources-ja/index.js', '@mescius/spread-sheets-vue': 'npm:@mescius/spread-sheets-vue/index.js', '@mescius/spread-sheets-tablesheet': 'npm:@mescius/spread-sheets-tablesheet/index.js', '@mescius/spread-sheets-ganttsheet': 'npm:@mescius/spread-sheets-ganttsheet/index.js' }, meta: { '*.css': { loader: 'systemjs-plugin-css' }, '*.vue': { loader: "../plugin-vue/index.js" } } }); })(this);