UI: minor fixes/improvements.
This commit is contained in:
parent
3a7b1ebf7c
commit
067545b06b
@ -277,6 +277,7 @@ export default class Subscription {
|
|||||||
var datasource = this.datasources[i];
|
var datasource = this.datasources[i];
|
||||||
for (var a = 0; a < datasource.dataKeys.length; a++) {
|
for (var a = 0; a < datasource.dataKeys.length; a++) {
|
||||||
var dataKey = datasource.dataKeys[a];
|
var dataKey = datasource.dataKeys[a];
|
||||||
|
dataKey.hidden = false;
|
||||||
dataKey.pattern = angular.copy(dataKey.label);
|
dataKey.pattern = angular.copy(dataKey.label);
|
||||||
var datasourceData = {
|
var datasourceData = {
|
||||||
datasource: datasource,
|
datasource: datasource,
|
||||||
@ -290,7 +291,6 @@ export default class Subscription {
|
|||||||
dataKey: dataKey,
|
dataKey: dataKey,
|
||||||
dataIndex: dataIndex++
|
dataIndex: dataIndex++
|
||||||
};
|
};
|
||||||
legendKey.dataKey.hidden = false;
|
|
||||||
this.legendData.keys.push(legendKey);
|
this.legendData.keys.push(legendKey);
|
||||||
var legendKeyData = {
|
var legendKeyData = {
|
||||||
min: null,
|
min: null,
|
||||||
|
|||||||
@ -437,11 +437,15 @@ function Utils($mdColorPalette, $rootScope, $window, $translate, $q, $timeout, t
|
|||||||
name: keyInfo.name,
|
name: keyInfo.name,
|
||||||
type: type,
|
type: type,
|
||||||
label: label,
|
label: label,
|
||||||
color: genNextColor(datasources),
|
|
||||||
funcBody: keyInfo.funcBody,
|
funcBody: keyInfo.funcBody,
|
||||||
settings: {},
|
settings: {},
|
||||||
_hash: Math.random()
|
_hash: Math.random()
|
||||||
}
|
}
|
||||||
|
if (keyInfo.color) {
|
||||||
|
dataKey.color = keyInfo.color;
|
||||||
|
} else {
|
||||||
|
dataKey.color = genNextColor(datasources);
|
||||||
|
}
|
||||||
return dataKey;
|
return dataKey;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -155,7 +155,7 @@ export default class TbFlot {
|
|||||||
var options = {
|
var options = {
|
||||||
title: null,
|
title: null,
|
||||||
subtitle: null,
|
subtitle: null,
|
||||||
shadowSize: settings.shadowSize || 4,
|
shadowSize: angular.isDefined(settings.shadowSize) ? settings.shadowSize : 4,
|
||||||
HtmlText: false,
|
HtmlText: false,
|
||||||
grid: {
|
grid: {
|
||||||
hoverable: true,
|
hoverable: true,
|
||||||
@ -235,6 +235,12 @@ export default class TbFlot {
|
|||||||
if (settings.grid.horizontalLines === false) {
|
if (settings.grid.horizontalLines === false) {
|
||||||
this.yaxis.tickLength = 0;
|
this.yaxis.tickLength = 0;
|
||||||
}
|
}
|
||||||
|
if (angular.isDefined(settings.grid.margin)) {
|
||||||
|
options.grid.margin = settings.grid.margin;
|
||||||
|
}
|
||||||
|
if (angular.isDefined(settings.grid.minBorderMargin)) {
|
||||||
|
options.grid.minBorderMargin = settings.grid.minBorderMargin;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
options.crosshair = {
|
options.crosshair = {
|
||||||
@ -327,6 +333,10 @@ export default class TbFlot {
|
|||||||
show: this.chartType === 'line' ? keySettings.showLines !== false : keySettings.showLines === true
|
show: this.chartType === 'line' ? keySettings.showLines !== false : keySettings.showLines === true
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (angular.isDefined(keySettings.lineWidth)) {
|
||||||
|
series.lines.lineWidth = keySettings.lineWidth;
|
||||||
|
}
|
||||||
|
|
||||||
series.points = {
|
series.points = {
|
||||||
show: false,
|
show: false,
|
||||||
radius: 8
|
radius: 8
|
||||||
@ -446,7 +456,7 @@ export default class TbFlot {
|
|||||||
hidden = hidden && yaxis.keysInfo[k].hidden;
|
hidden = hidden && yaxis.keysInfo[k].hidden;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
yaxis.hidden = hidden
|
yaxis.hidden = hidden;
|
||||||
var newIndex = -1;
|
var newIndex = -1;
|
||||||
if (!yaxis.hidden) {
|
if (!yaxis.hidden) {
|
||||||
this.options.yaxes.push(yaxis);
|
this.options.yaxes.push(yaxis);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user