<p>Spread.Sheets支持一下三种形状类型</p>
<ul>
<li><strong>基础形状: 基础形状可以单独使用。</strong></li>
<li><strong>线条形状: 线条形状即可以单独使用也可以链接其他基础形状。</strong></li>
<li><strong>分组形状: 分组形状并不是一个真实的形状,但是被用作一个形状的管理者,以便方便快捷的操作一组形状。</strong></li>
</ul>
<p>使用形状功能需要添加如下的JS文件到文档的Head部分:</p>
<pre><code class="hljs js language-js"><head>
...
<script src='.../spreadjs/gc.spread.sheets.all.x.x.x.min.js' type='text/javascript'></script>
<script src='.../spreadjs/plugins/gc.spread.sheets.shapes.x.x.x.min.js' type='text/javascript'></script>
</head>
</code></pre>
<p>你可以使用<strong>ShapeCollection</strong>类上的API来管理所有的形状:</p>
<p>你可以通过 <strong>sheet.shapes.add</strong> 方法创建一个基础形状:</p>
<pre><code class="hljs js language-js">sheet.shapes.add(<span class="hljs-string">'autoShape'</span>, GC.Spread.Sheets.Shapes.AutoShapeType.heart, <span class="hljs-number">100</span>, <span class="hljs-number">50</span>, <span class="hljs-number">100</span>, <span class="hljs-number">150</span>);
</code></pre>
<p>你可以通过<strong>sheet.shapes.addConnector</strong>方法创建一个线条形状:</p>
<pre><code class="hljs js language-js">sheet.shapes.addConnector(<span class="hljs-string">'connectorShape'</span>, GC.Spread.Sheets.Shapes.ConnectorType.elbow, <span class="hljs-number">200</span>, <span class="hljs-number">50</span>, <span class="hljs-number">300</span>, <span class="hljs-number">200</span>);
</code></pre>
<p>你可以根据形状的名字来获取或删除一个形状:</p>
<pre><code class="hljs js language-js">sheet.shapes.add(<span class="hljs-string">"shape1"</span>, GC.Spread.Sheets.Shapes.AutoShapeType.heart, <span class="hljs-number">100</span>, <span class="hljs-number">50</span>, <span class="hljs-number">100</span>, <span class="hljs-number">150</span>);
activeSheet.shapes.get(<span class="hljs-string">"shape1"</span>);
activeSheet.shapes.remove(<span class="hljs-string">"shape1"</span>);
</code></pre>
<p>你可以通过<strong>ShapeBase</strong>类上的API来定制任意类型的形状:</p>
<ul>
<li><strong>allowMove: 获取或设置形状是否能够移动。</strong></li>
<li><strong>allowResize: 获取或设置形状是否能够改变大小。</strong></li>
<li><strong>allowRotate: 获取或者设置形状是否可以旋转</strong></li>
<li><strong>showHandle: 获得或者设置显示形状操作手柄</strong></li>
<li><strong>isSelected: 获取或设置形状是否被选择。</strong></li>
<li><strong>width/height: 获取或设置形状的高宽。</strong></li>
<li><strong>x/y: 获取或设置形状的X/Y点。</strong></li>
</ul>
<pre><code class="hljs js language-js"><span class="hljs-keyword">var</span> heart = sheet.shapes.add(<span class="hljs-string">"Shape1"</span>, GC.Spread.Sheets.Shapes.AutoShapeType.heart, <span class="hljs-number">100</span>, <span class="hljs-number">60</span>, <span class="hljs-number">200</span>, <span class="hljs-number">160</span>);
<span class="hljs-keyword">var</span> state = heart.allowMove();
heart.allowMove(!state);
<span class="hljs-keyword">var</span> state = heart.allowResize();
heart.allowResize(!state);
<span class="hljs-keyword">var</span> state = heart.allowRotate();
heart.allowRotate(!state);
<span class="hljs-keyword">var</span> showHandle = heart.showHandle();
heart.showHandle(!showHandle);
<span class="hljs-keyword">var</span> state = heart.isSelected();
heart.isSelected(!state);
<span class="hljs-keyword">var</span> n = heart.width();
heart.width(n + <span class="hljs-number">50</span>);
<span class="hljs-keyword">var</span> n = heart.y();
heart.y(n + <span class="hljs-number">50</span>);
</code></pre>
<p>你可以通过<strong>Shape</strong>类上的API来定制基础形状:</p>
<ul>
<li><strong>rotate: 获取或设置形状的旋转角度(单位是角度).</strong></li>
<li><strong>text: 获取或设置形状内的文字。</strong></li>
<li><strong>style: 获取或这是形状的样式。</strong></li>
</ul>
<pre><code class="hljs js language-js"><span class="hljs-keyword">var</span> heart = sheet.shapes.add(<span class="hljs-string">"Shape1"</span>, GC.Spread.Sheets.Shapes.AutoShapeType.heart, <span class="hljs-number">100</span>, <span class="hljs-number">60</span>, <span class="hljs-number">200</span>, <span class="hljs-number">160</span>);
<span class="hljs-keyword">var</span> heartStyle = heart.style();
heartStyle.fill.color = <span class="hljs-string">'pink'</span>;
heartStyle.fill.transparency = <span class="hljs-number">0.5</span>;
heartStyle.line.color = <span class="hljs-string">'red'</span>;
heartStyle.line.lineStyle = GC.Spread.Sheets.Shapes.PresetLineDashStyle.dashDot;
heartStyle.line.width = <span class="hljs-number">5</span>;
heartStyle.line.capType = GC.Spread.Sheets.Shapes.LineCapStyle.square;
heartStyle.line.joinType = GC.Spread.Sheets.Shapes.LineJoinStyle.miter;
heartStyle.line.transparency = <span class="hljs-number">0.5</span>;
heartStyle.textEffect.color = <span class="hljs-string">'yellow'</span>;
heartStyle.textEffect.transparency = <span class="hljs-number">0.5</span>;
heartStyle.textEffect.font = <span class="hljs-string">'20px Arial'</span>;
heartStyle.textFrame.vAlign = GC.Spread.Sheets.VerticalAlign.center;
heartStyle.textFrame.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
heart.style(heartStyle);
heart.text(<span class="hljs-string">'Heart'</span>);
</code></pre>
<p>你可以通过<strong>ConnectorShape</strong>类上的API来定制线条形状:</p>
<ul>
<li><strong>style: 获取或设置形状的样式。</strong></li>
</ul>
<pre><code class="hljs js language-js"><span class="hljs-keyword">var</span> shape1 = sheet.shapes.add(<span class="hljs-string">"myShape1"</span>, GC.Spread.Sheets.Shapes.AutoShapeType.rectangle, <span class="hljs-number">62</span> * <span class="hljs-number">9</span>, <span class="hljs-number">0</span>, <span class="hljs-number">200</span>, <span class="hljs-number">200</span>)
<span class="hljs-keyword">var</span> shape2 = sheet.shapes.addConnector(<span class="hljs-string">"myShape2"</span>, GC.Spread.Sheets.Shapes.ConnectorType.straight, <span class="hljs-number">220</span>, <span class="hljs-number">120</span>, <span class="hljs-number">300</span>, <span class="hljs-number">120</span>);
<span class="hljs-keyword">var</span> oldStyle = shape2.style();
oldStyle.line.color = <span class="hljs-string">'red'</span>;
oldStyle.line.lineStyle = GC.Spread.Sheets.Shapes.PresetLineDashStyle.dashDot;
oldStyle.line.width = <span class="hljs-number">5</span>;
oldStyle.line.capType = GC.Spread.Sheets.Shapes.LineCapStyle.square;
oldStyle.line.joinType = GC.Spread.Sheets.Shapes.LineJoinStyle.miter;
oldStyle.line.transparency = <span class="hljs-number">0.5</span>;
oldStyle.line.beginArrowheadStyle = GC.Spread.Sheets.Shapes.ArrowheadStyle.triangle;
oldStyle.line.beginArrowheadWidth = GC.Spread.Sheets.Shapes.ArrowheadWidth.narrow;
oldStyle.line.beginArrowheadLength = GC.Spread.Sheets.Shapes.ArrowheadLength.short;
oldStyle.line.endArrowheadStyle = GC.Spread.Sheets.Shapes.ArrowheadStyle.diamond;
oldStyle.line.endArrowheadWidth = GC.Spread.Sheets.Shapes.ArrowheadWidth.wide;
oldStyle.line.endArrowheadLength = GC.Spread.Sheets.Shapes.ArrowheadLength.long;
shape2.style(oldStyle);
<span class="hljs-keyword">var</span> startConnector = shape2.startConnector();
shape2.startConnector({<span class="hljs-attr">name</span>: shape1.name(), <span class="hljs-attr">index</span>: <span class="hljs-number">2</span>});
</code></pre>
window.onload = function () {
var spread = new GC.Spread.Sheets.Workbook(document.getElementById("ss"));
initSpread(spread);
initEvent(spread);
};
var lineCapStyle = {
flat: 2,
square: 1,
round: 0
};
var lineJoinStyle = {
round: 0,
miter: 1,
bevel: 2
};
var lineDashStyle = {
solid: 0,
squareDot: 1,
dash: 2,
longDash: 3,
dashDot: 4,
longDashDot: 5,
longDashDotDot: 6,
sysDash: 7,
sysDot: 8,
sysDashDot: 9,
dashDotDot: 10
};
var arrowheadLength = {
"short" : 0,
"medium" : 1,
"long" : 2
};
var arrowheadWidth = {
"narrow" : 0,
"medium" : 1,
"wide" : 2
};
var horizontalAlign = {
left: 0,
center: 1,
right: 2
};
var verticalAlign = {
top: 0,
center: 1,
bottom: 2
};
var activeShape;
function fillShapeTypeList(type, dom) {
var names = [];
for (var name in type) {
if(name === "none" || (parseInt(name, 10)) == name) {
continue;
}
names.push({name: name, value: type[name]});
}
names.sort(function (a, b) {
return a.name > b.name ? 1 : -1
});
var html = "";
names.forEach(function (item) {
html += '<option value="' + item.value + '">' + item.name + '</option>';
});
dom.innerHTML= html;
}
function getActiveConnectorShape(sheet) {
return sheet.shapes.all().filter(function(sp){
return sp.isSelected() && sp instanceof GC.Spread.Sheets.Shapes.ConnectorShape;
});
}
function initSpread(spread) {
setShapePropVisibility("none");
setConnectorPropVisibility("none");
setBorderPropVisibility("none");
fillShapeTypeList(GC.Spread.Sheets.Shapes.AutoShapeType, _getElementById("autoShapeType"));
fillShapeTypeList(GC.Spread.Sheets.Shapes.ConnectorType, _getElementById("connectShapeType"));
fillShapeTypeList(lineDashStyle, _getElementById("borderLineStyle"));
fillShapeTypeList(lineCapStyle, _getElementById("borderCapLineStyle"));
fillShapeTypeList(lineJoinStyle, _getElementById("borderJoinLineStyle"));
fillShapeTypeList(horizontalAlign, _getElementById("txtHAlign"));
fillShapeTypeList(verticalAlign, _getElementById("txtVAlign"));
fillShapeTypeList(GC.Spread.Sheets.Shapes.ArrowheadStyle, _getElementById("beginArrowheadStyle"));
fillShapeTypeList(GC.Spread.Sheets.Shapes.ArrowheadStyle, _getElementById("endArrowheadStyle"));
fillShapeTypeList(arrowheadLength, _getElementById("beginArrowheadLength"));
fillShapeTypeList(arrowheadLength, _getElementById("endArrowheadLength"));
fillShapeTypeList(arrowheadWidth, _getElementById("beginArrowheadWidth"));
fillShapeTypeList(arrowheadWidth, _getElementById("endArrowheadWidth"));
_getElementById("txtText").value = "abcdefgHIJKLMN\n" + "12356789\n" + "SpreadJSSpreadJS";
spread.getActiveSheet().shapes.add("heart", GC.Spread.Sheets.Shapes.AutoShapeType.heart, 40, 20, 150, 150);
var lineShape = spread.getActiveSheet().shapes.addConnector("line", GC.Spread.Sheets.Shapes.ConnectorType.straight, 290, 20, 420, 170);
var lineShapeStyle = lineShape.style();
lineShapeStyle.line.width = 8;
lineShape.style(lineShapeStyle);
}
function setShapePropVisibility(display) {
var shapeFillProp = _getElementById("shapeFillProp");
var shapeTxtProp = _getElementById("shapeTxtProp");
shapeFillProp.style.display = display;
shapeTxtProp.style.display = display;
}
function setConnectorPropVisibility(display) {
var connectorProp = _getElementById("connectorProp");
connectorProp.style.display = display;
}
function setBorderPropVisibility(display) {
var borderProp = _getElementById("borderProp");
borderProp.style.display = display;
}
function initEvent(spread) {
var spreadNS = GC.Spread.Sheets;
var sheet = spread.getActiveSheet();
sheet.bind(spreadNS.Events.ShapeSelectionChanged, function () {
var selectedShape = sheet.shapes.all().filter(function(sp){
return sp.isSelected();
});
var isShapeSelected = false, isConnectorSelected = false;
if (selectedShape.length > 0) {
selectedShape.forEach(function (shape) {
if (!isShapeSelected && shape instanceof spreadNS.Shapes.Shape) {
isShapeSelected = true;
} else if (!isConnectorSelected && shape instanceof spreadNS.Shapes.ConnectorShape) {
isConnectorSelected = true;
}
});
if (isShapeSelected) {
setShapePropVisibility("block");
} else {
setShapePropVisibility("none");
}
if (isConnectorSelected) {
setConnectorPropVisibility("block");
} else {
setConnectorPropVisibility("none");
}
setBorderPropVisibility("block");
} else {
setShapePropVisibility("none");
setConnectorPropVisibility("none");
setBorderPropVisibility("none");
}
});
_getElementById("rotateActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'rotate', _getElementById("txtRotate"));
});
_getElementById("backgroundActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'background', _getElementById("txtFillColor"));
});
_getElementById("transparencyActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'transparency', _getElementById("txtFillTransparency"));
});
_getElementById("textActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'text', _getElementById("txtText"));
});
_getElementById("colorActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'color', _getElementById("txtTextColor"));
});
_getElementById("transparencyTxtActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'transparencyTxt', _getElementById("txtTextTransparency"));
});
_getElementById("fontActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'font', _getElementById("txtFont"));
});
_getElementById("hAlignActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'hAlign', _getElementById("txtHAlign"));
});
_getElementById("vAlignActionBtn").addEventListener('click', function() {
_handleShapeStyleSetting(spread, 'vAlign', _getElementById("txtVAlign"));
});
_getElementById("borderColorActionBtn").addEventListener('click', function() {
_handleShapeBorderAction(spread, 'color', _getElementById("borderColorStyle"));
});
_getElementById("borderTransparencyActionBtn").addEventListener('click', function() {
_handleShapeBorderAction(spread, 'transparency', _getElementById("borderTransparencyStyle"));
});
_getElementById("borderWidthActionBtn").addEventListener('click', function() {
_handleShapeBorderAction(spread, 'width', _getElementById("borderWidthStyle"));
});
_getElementById("borderLineStyleActionBtn").addEventListener('click', function() {
_handleShapeBorderAction(spread, 'lineStyle', _getElementById("borderLineStyle"));
});
_getElementById("borderCapLineActionBtn").addEventListener('click', function() {
_handleShapeBorderAction(spread, 'capType', _getElementById("borderCapLineStyle"));
});
_getElementById("borderJoinLineActionBtn").addEventListener('click', function() {
_handleShapeBorderAction(spread, 'joinType', _getElementById("borderJoinLineStyle"));
});
_getElementById("insertShape").addEventListener('click', function () {
var sheet = spread.getActiveSheet(), shapes = sheet.shapes, total = shapes.all().length;
var x = 40 + (total % 2) * 250, y = parseInt(total / 2) * 200 + 20;
var shape = shapes.add('', _getElementById("autoShapeType").value, x, y);
_setShapeStyle(shape, 'hAlign', 1);
});
_getElementById("insertConnectShape").addEventListener('click', function() {
var sheet = spread.getActiveSheet(), shapes = sheet.shapes, total = shapes.all().length;
var x = 40 + (total % 2) * 250, y = parseInt(total / 2) * 200 + 20;
shapes.addConnector('', parseInt(_getElementById("connectShapeType").value), x, y, x + 200, y + 200);
});
_getElementById("beginArrowheadStyleActionBtn").addEventListener('click', function() {
_handleConnectorShapeStyleSetting(spread, 'beginStyle', _getElementById("beginArrowheadStyle"));
});
_getElementById("beginArrowheadWidthActionBtn").addEventListener('click', function() {
_handleConnectorShapeStyleSetting(spread, 'beginWidth', _getElementById("beginArrowheadWidth"));
});
_getElementById("beginArrowheadLengthActionBtn").addEventListener('click', function() {
_handleConnectorShapeStyleSetting(spread, 'beginLength', _getElementById("beginArrowheadLength"));
});
_getElementById("endArrowheadStyleActionBtn").addEventListener('click', function() {
_handleConnectorShapeStyleSetting(spread, 'endStyle', _getElementById("endArrowheadStyle"));
});
_getElementById("endArrowheadWidthActionBtn").addEventListener('click', function() {
_handleConnectorShapeStyleSetting(spread, 'endWidth', _getElementById("endArrowheadWidth"));
});
_getElementById("endArrowheadLengthActionBtn").addEventListener('click', function() {
_handleConnectorShapeStyleSetting(spread, 'endLength', _getElementById("endArrowheadLength"));
});
}
function _handleShapeStyleSetting(spread, action, valueDom) {
var sheet = spread.getActiveSheet();
activeShape = sheet.shapes.all().filter(function(sp){
return sp.isSelected();
});
if (activeShape.length > 0) {
activeShape.forEach(function (shape) {
if (shape instanceof GC.Spread.Sheets.Shapes.Shape) {
_setShapeStyle(shape, action, valueDom.value);
}
});
sheet.repaint();
}
}
function _setShapeStyle(shape, action, value) {
if (action === 'rotate') {
shape.rotate(value);
} else if (action === 'text') {
shape.text(value);
} else {
var shapeStyle = shape.style();
if (action === 'background') {
shapeStyle.fill.color = value;
} else if (action === 'transparency') {
shapeStyle.fill.transparency = value;
} else if (action ==='color') {
shapeStyle.textEffect.color = value;
} else if (action === 'transparencyTxt') {
shapeStyle.textEffect.transparency = value;
} else if (action === 'font') {
shapeStyle.textEffect.font = value;
} else if (action === 'hAlign') {
shapeStyle.textFrame.hAlign = parseInt(value);
} else if (action === 'vAlign') {
shapeStyle.textFrame.vAlign = parseInt(value);
}
shape.style(shapeStyle);
}
}
function _handleShapeBorderAction(spread, action, valueDom) {
var sheet = spread.getActiveSheet();
activeShape = sheet.shapes.all().filter(function (sp) {
return sp.isSelected();
});
if (activeShape) {
activeShape.forEach(function (shape) {
var shapeStyle = shape.style();
shapeStyle.line[action] = valueDom.value;
shape.style(shapeStyle);
});
sheet.repaint();
}
}
function _handleConnectorShapeStyleSetting(spread, action, valueDom) {
var sheet = spread.getActiveSheet();
activeShape = getActiveConnectorShape(sheet);
if(activeShape.length > 0) {
activeShape.forEach(function (shape) {
_setConnectorShapeStyle(shape, action, parseInt(valueDom.value));
});
sheet.repaint();
}
}
function _setConnectorShapeStyle(shape, action, value) {
var shapeStyle = shape.style();
var shapeStyleLine = shapeStyle.line;
switch (action) {
case "beginStyle": {
shapeStyleLine.beginArrowheadStyle = value;
break;
}
case "beginWidth": {
shapeStyleLine.beginArrowheadWidth = value;
break;
}
case "beginLength": {
shapeStyleLine.beginArrowheadLength = value;
break;
}
case "endStyle": {
shapeStyleLine.endArrowheadStyle = value;
break;
}
case "endWidth": {
shapeStyleLine.endArrowheadWidth = value;
break;
}
case "endLength": {
shapeStyleLine.endArrowheadLength = value;
break;
}
}
shape.style(shapeStyle);
}
function _getElementById(id){
return document.getElementById(id);
}
<!doctype html>
<html style="height:100%;font-size:14px;">
<head>
<meta name="spreadjs culture" content="zh-cn" />
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link rel="stylesheet" type="text/css" href="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets/styles/gc.spread.sheets.excel2013white.css">
<script src="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets/dist/gc.spread.sheets.all.min.js" type="text/javascript"></script>
<script src="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets-shapes/dist/gc.spread.sheets.shapes.min.js" type="text/javascript"></script>
<script src="$DEMOROOT$/zh/purejs/node_modules/@grapecity/spread-sheets-resources-zh/dist/gc.spread.sheets.resources.zh.min.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 class="sample-tutorial">
<div id="ss" class="sample-spreadsheets"></div>
<div class="options-container">
<div class="option-row">
Try selecting a shape from either of the drop-down menus and click the ‘Add’ button to add that shape to the Spread instance.
</div>
<div class="option-row">
<label for='autoShapeType'>Add Shape: </label>
<select id='autoShapeType' class="shapeSelect"></select>
<input type='button' id='insertShape' value="Add"/>
<label for='connectShapeType'>Add Connect Shape: </label>
<select id='connectShapeType' class="shapeSelect"></select>
<input type='button' id='insertConnectShape' value="Add"/>
</div>
<div id="divideLine" class="divide-line"></div>
<div id="borderProp" class="option-row">
<label class="title">Shape Border</label>
<label>Border Color: </label>
<input id="borderColorStyle" data-attr="color" type="color" value="#00A2E8"/>
<input type="button" id='borderColorActionBtn' value="Set"/>
<label>Border Transparency: </label>
<input id="borderTransparencyStyle" data-attr="transparency" type="text" value="0.5"/>
<input type="button" id='borderTransparencyActionBtn' value="Set"/>
<label>Border Width: </label>
<input id="borderWidthStyle" data-attr="width" type="number" value="1"/>
<input type="button" id='borderWidthActionBtn' value="Set"/>
<label>Border Line Style: </label>
<select id="borderLineStyle" data-attr="lineStyle"></select>
<input type="button" id='borderLineStyleActionBtn' value="Set"/>
<label>Border Cap Line Style: </label>
<select id="borderCapLineStyle" data-attr="capType"></select>
<input type="button" id='borderCapLineActionBtn' value="Set"/>
<label>Border Join Line Style: </label>
<select id="borderJoinLineStyle" data-attr="joinType"></select>
<input type="button" id='borderJoinLineActionBtn' value="Set"/>
</div>
<div id="shapeFillProp" class="option-row">
<div class="divide-line"></div>
<label class="title">Shape Fill and Rotate</label>
<label>Fill Color: </label>
<input id='txtFillColor' type="color" value="#00A2E8"/>
<input type="button" id='backgroundActionBtn' value="Set"/>
<label>Fill Transparency: </label>
<input id='txtFillTransparency' type="text" value="0.5"/>
<input type="button" id='transparencyActionBtn' value="Set"/>
<label for='txtRotate'>Rotate: </label>
<input id='txtRotate' type="number" value="30" min="0" max="360"/>
<input type="button" id='rotateActionBtn' value="Set"/>
</div>
<div id="shapeTxtProp" class="option-row">
<div class="divide-line"></div>
<label class="title">Shape Text</label>
<label>Text: </label>
<textarea id='txtText' type="text" placeholder="Shape text" rows="3"></textarea>
<input type="button" id='textActionBtn' value="Set"/>
<label>Text Color: </label>
<input id='txtTextColor' type="color" value="#FFFF00"/>
<input type="button" id='colorActionBtn' value="Set"/>
<label>Text Transparency: </label>
<input id='txtTextTransparency' type="text" value="0.5"/>
<input type="button" id='transparencyTxtActionBtn' value="Set"/>
<label>Text Font: </label>
<input id='txtFont' type="text" value="bold 15px Georgia"/>
<input type="button" id='fontActionBtn' value="Set"/>
<label> Horizontal Align:</label>
<select id="txtHAlign"></select>
<input type="button" id='hAlignActionBtn' value="Set"/>
<label>Vertical Align:</label>
<select id="txtVAlign"></select>
<input type="button" id='vAlignActionBtn' value="Set"/>
</div>
<div id="connectorProp" class="option-row">
<div class="divide-line"></div>
<label class="title">Shape Arrow Head</label>
<label for="beginArrowheadStyle">Begin Arrowhead Style:</label>
<select id='beginArrowheadStyle' class="shapeSelect"></select>
<input id="beginArrowheadStyleActionBtn" type="button" data-attr="style" data-isBegin=true class='value arrow-action-button' value="Set"/>
<label>Begin Arrowhead Width:</label>
<select id="beginArrowheadWidth" class="shapeSelect"></select>
<input id="beginArrowheadWidthActionBtn" type="button" data-attr="width" data-isBegin=true class='value arrow-action-button' value="Set"/>
<label>Begin Arrowhead Length:</label>
<select id="beginArrowheadLength" class="shapeSelect"></select>
<input id="beginArrowheadLengthActionBtn" type="button" data-attr="length" data-isBegin=true class='value arrow-action-button' value="Set"/>
<label for="endArrowheadStyle">End Arrowhead Style:</label>
<select id='endArrowheadStyle' class="shapeSelect"></select>
<input id="endArrowheadStyleActionBtn" type="button" data-attr="style" data-isBegin=false
class='value arrow-action-button' value="Set"/>
<label>End Arrowhead Width:</label>
<select id="endArrowheadWidth" class="shapeSelect"></select>
<input id="endArrowheadWidthActionBtn" type="button" data-attr="width" data-isBegin=false class='value arrow-action-button' value="Set"/>
<label>End Arrowhead Length:</label>
<select id="endArrowheadLength" class="shapeSelect"></select>
<input id="endArrowheadLengthActionBtn" type="button" data-attr="length" data-isBegin=false class='value arrow-action-button' value="Set"/>
</div>
</div>
</div></body>
</html>
.sample-tutorial {
position: relative;
height: 100%;
overflow: hidden;
}
.sample-spreadsheets {
width: calc(100% - 280px);
height: 100%;
overflow: hidden;
float: left;
}
.options-container {
float: right;
width: 280px;
padding: 12px;
height: 100%;
box-sizing: border-box;
background: #fbfbfb;
overflow: auto;
}
.option-row {
font-size: 14px;
padding-left: 5px;
}
.divide-line {
width: 100%;
height: 1px;
background: #cbcbcb;
margin-top: 10px;
margin-bottom: 3px;
}
.title {
text-align: center;
font-weight: bold;
}
label {
display: block;
margin-top: 15px;
margin-bottom: 5px;
}
p {
padding: 2px 10px;
background-color: lavender;
}
input {
width: 160px;
margin-left: 10px;
display: inline;
}
input[type=button] {
width: 50px;
margin-left: 1px;
}
select {
width: 160px;
margin-left: 10px;
display: inline;
}
textarea {
width: 160px;
margin-left: 10px;
}
body {
position: absolute;
top: 0;
bottom: 0;
left: 0;
right: 0;
}