Commit 338f5c71 authored by Mahdi Mahmoudy's avatar Mahdi Mahmoudy
Browse files

with dropdown list to multiply chart size

parent 6ed199e2
......@@ -12,6 +12,14 @@
<label>
<input type="checkbox" ng-model="$parent.showIds"> Show Ids
</label>
<label>Multiply chart size
<select
ng-options="item as item.name for item in multiplyChartSizeItems"
ng-model="multiplyChartSizeSelected"
ng-change="multiplyChartSize(multiplyChartSizeSelected)"
ng-init="item=multiplyChartSizeItems[0]">
</select>
</label>
<label>Term box width
<input type="number" ng-model="$parent.termBoxWidth">
</label>
......
......@@ -19,9 +19,47 @@ angular
scope.showChildren = false;
var that = this;
scope.applyOptions = function(){
scope.applyOptions = function() {
scope.originalChartSizeValues = null;
that.drawChart(scope);
};
scope.multiplyChartSizeItems = [
{ name: "Do not multiply", value: 1 },
{ name: "Multiply by 2", value: 2 },
{ name: "Multiply by 3", value: 3 },
{ name: "Multiply by 4", value: 4 },
];
scope.originalChartSizeValues = null;
scope.multiplyChartSize = function(selectedItem) {
var size = selectedItem.value;
if (!size) {
return;
}
if (!scope.originalChartSizeValues) {
scope.originalChartSizeValues = {
width: scope.termBoxWidth,
height: scope.termBoxHeight,
font: scope.fontSize,
};
}
if (size === 1) {
scope.termBoxWidth = scope.originalChartSizeValues.width;
scope.termBoxHeight = scope.originalChartSizeValues.height;
scope.fontSize = scope.originalChartSizeValues.font;
}
scope.termBoxWidth *= size;
scope.termBoxHeight *= size;
scope.fontSize *= size;
}
this.drawChart(scope);
},
drawChart: function(scope) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment