Commit 067545b06ba6e0669021aed94166977ee0b060fc

Authored by Igor Kulikov
1 parent 3a7b1ebf

UI: minor fixes/improvements.

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