Commit 067545b06ba6e0669021aed94166977ee0b060fc

Authored by Igor Kulikov
1 parent 3a7b1ebf

UI: minor fixes/improvements.

@@ -277,6 +277,7 @@ export default class Subscription { @@ -277,6 +277,7 @@ export default class Subscription {
277 var datasource = this.datasources[i]; 277 var datasource = this.datasources[i];
278 for (var a = 0; a < datasource.dataKeys.length; a++) { 278 for (var a = 0; a < datasource.dataKeys.length; a++) {
279 var dataKey = datasource.dataKeys[a]; 279 var dataKey = datasource.dataKeys[a];
  280 + dataKey.hidden = false;
280 dataKey.pattern = angular.copy(dataKey.label); 281 dataKey.pattern = angular.copy(dataKey.label);
281 var datasourceData = { 282 var datasourceData = {
282 datasource: datasource, 283 datasource: datasource,
@@ -290,7 +291,6 @@ export default class Subscription { @@ -290,7 +291,6 @@ export default class Subscription {
290 dataKey: dataKey, 291 dataKey: dataKey,
291 dataIndex: dataIndex++ 292 dataIndex: dataIndex++
292 }; 293 };
293 - legendKey.dataKey.hidden = false;  
294 this.legendData.keys.push(legendKey); 294 this.legendData.keys.push(legendKey);
295 var legendKeyData = { 295 var legendKeyData = {
296 min: null, 296 min: null,
@@ -437,11 +437,15 @@ function Utils($mdColorPalette, $rootScope, $window, $translate, $q, $timeout, t @@ -437,11 +437,15 @@ function Utils($mdColorPalette, $rootScope, $window, $translate, $q, $timeout, t
437 name: keyInfo.name, 437 name: keyInfo.name,
438 type: type, 438 type: type,
439 label: label, 439 label: label,
440 - color: genNextColor(datasources),  
441 funcBody: keyInfo.funcBody, 440 funcBody: keyInfo.funcBody,
442 settings: {}, 441 settings: {},
443 _hash: Math.random() 442 _hash: Math.random()
444 } 443 }
  444 + if (keyInfo.color) {
  445 + dataKey.color = keyInfo.color;
  446 + } else {
  447 + dataKey.color = genNextColor(datasources);
  448 + }
445 return dataKey; 449 return dataKey;
446 } 450 }
447 451
@@ -155,7 +155,7 @@ export default class TbFlot { @@ -155,7 +155,7 @@ export default class TbFlot {
155 var options = { 155 var options = {
156 title: null, 156 title: null,
157 subtitle: null, 157 subtitle: null,
158 - shadowSize: settings.shadowSize || 4, 158 + shadowSize: angular.isDefined(settings.shadowSize) ? settings.shadowSize : 4,
159 HtmlText: false, 159 HtmlText: false,
160 grid: { 160 grid: {
161 hoverable: true, 161 hoverable: true,
@@ -235,6 +235,12 @@ export default class TbFlot { @@ -235,6 +235,12 @@ export default class TbFlot {
235 if (settings.grid.horizontalLines === false) { 235 if (settings.grid.horizontalLines === false) {
236 this.yaxis.tickLength = 0; 236 this.yaxis.tickLength = 0;
237 } 237 }
  238 + if (angular.isDefined(settings.grid.margin)) {
  239 + options.grid.margin = settings.grid.margin;
  240 + }
  241 + if (angular.isDefined(settings.grid.minBorderMargin)) {
  242 + options.grid.minBorderMargin = settings.grid.minBorderMargin;
  243 + }
238 } 244 }
239 245
240 options.crosshair = { 246 options.crosshair = {
@@ -327,6 +333,10 @@ export default class TbFlot { @@ -327,6 +333,10 @@ export default class TbFlot {
327 show: this.chartType === 'line' ? keySettings.showLines !== false : keySettings.showLines === true 333 show: this.chartType === 'line' ? keySettings.showLines !== false : keySettings.showLines === true
328 }; 334 };
329 335
  336 + if (angular.isDefined(keySettings.lineWidth)) {
  337 + series.lines.lineWidth = keySettings.lineWidth;
  338 + }
  339 +
330 series.points = { 340 series.points = {
331 show: false, 341 show: false,
332 radius: 8 342 radius: 8
@@ -446,7 +456,7 @@ export default class TbFlot { @@ -446,7 +456,7 @@ export default class TbFlot {
446 hidden = hidden && yaxis.keysInfo[k].hidden; 456 hidden = hidden && yaxis.keysInfo[k].hidden;
447 } 457 }
448 } 458 }
449 - yaxis.hidden = hidden 459 + yaxis.hidden = hidden;
450 var newIndex = -1; 460 var newIndex = -1;
451 if (!yaxis.hidden) { 461 if (!yaxis.hidden) {
452 this.options.yaxes.push(yaxis); 462 this.options.yaxes.push(yaxis);