mirror of
https://github.com/elastic/kibana.git
synced 2025-04-23 17:28:26 -04:00
This fixes issues where properties from the visualizations saved in older versions were not applied to the Visualization. This also addressed the fontSize of metrics not being applied on the Dashboard.
This commit is contained in:
parent
faeade72fd
commit
1734f4f14e
10 changed files with 49 additions and 42 deletions
|
@ -60,7 +60,9 @@ export default function PointSeriesVisType(Private) {
|
|||
filter: false,
|
||||
truncate: 100
|
||||
},
|
||||
title: {}
|
||||
title: {
|
||||
text: 'Count'
|
||||
}
|
||||
}
|
||||
],
|
||||
seriesParams: [{
|
||||
|
@ -79,15 +81,8 @@ export default function PointSeriesVisType(Private) {
|
|||
addTooltip: true,
|
||||
addLegend: true,
|
||||
legendPosition: 'right',
|
||||
showCircles: true,
|
||||
interpolate: 'linear',
|
||||
scale: 'linear',
|
||||
drawLinesBetweenPoints: true,
|
||||
radiusRatio: 9,
|
||||
times: [],
|
||||
addTimeMarker: false,
|
||||
defaultYExtents: false,
|
||||
setYExtents: false
|
||||
},
|
||||
positions: ['top', 'left', 'right', 'bottom'],
|
||||
chartTypes: [{
|
||||
|
|
|
@ -37,7 +37,7 @@
|
|||
id="gridAxis"
|
||||
class="kuiSelect kuiSideBarSelect"
|
||||
ng-model="vis.params.grid.valueAxis"
|
||||
ng-options="axis.id as axis.name for axis in vis.params.valueAxes"
|
||||
ng-options="axis.id as axis.name for axis in vis.params.valueAxes track by axis.id"
|
||||
>
|
||||
<option value="">Don't show</option>
|
||||
</select>
|
||||
|
|
|
@ -60,7 +60,9 @@ export default function PointSeriesVisType(Private) {
|
|||
filter: false,
|
||||
truncate: 100
|
||||
},
|
||||
title: {}
|
||||
title: {
|
||||
text: 'Count'
|
||||
}
|
||||
}
|
||||
],
|
||||
seriesParams: [
|
||||
|
@ -80,15 +82,8 @@ export default function PointSeriesVisType(Private) {
|
|||
addTooltip: true,
|
||||
addLegend: true,
|
||||
legendPosition: 'right',
|
||||
showCircles: true,
|
||||
interpolate: 'linear',
|
||||
scale: 'linear',
|
||||
drawLinesBetweenPoints: true,
|
||||
radiusRatio: 9,
|
||||
times: [],
|
||||
addTimeMarker: false,
|
||||
defaultYExtents: false,
|
||||
setYExtents: false
|
||||
},
|
||||
positions: ['top', 'left', 'right', 'bottom'],
|
||||
chartTypes: [{
|
||||
|
|
|
@ -62,7 +62,9 @@ export default function PointSeriesVisType(Private) {
|
|||
filter: true,
|
||||
truncate: 100
|
||||
},
|
||||
title: {}
|
||||
title: {
|
||||
text: 'Count'
|
||||
}
|
||||
}
|
||||
],
|
||||
seriesParams: [{
|
||||
|
@ -80,15 +82,8 @@ export default function PointSeriesVisType(Private) {
|
|||
addTooltip: true,
|
||||
addLegend: true,
|
||||
legendPosition: 'right',
|
||||
showCircles: true,
|
||||
interpolate: 'linear',
|
||||
scale: 'linear',
|
||||
drawLinesBetweenPoints: true,
|
||||
radiusRatio: 9,
|
||||
times: [],
|
||||
addTimeMarker: false,
|
||||
defaultYExtents: false,
|
||||
setYExtents: false
|
||||
},
|
||||
positions: ['top', 'left', 'right', 'bottom'],
|
||||
chartTypes: [{
|
||||
|
|
|
@ -60,22 +60,30 @@ export default function PointSeriesVisType(Private) {
|
|||
filter: false,
|
||||
truncate: 100
|
||||
},
|
||||
title: {}
|
||||
title: {
|
||||
text: 'Count'
|
||||
}
|
||||
}
|
||||
],
|
||||
seriesParams: [
|
||||
{
|
||||
show: 'true',
|
||||
type: 'line',
|
||||
mode: 'normal',
|
||||
data: {
|
||||
label: 'Count',
|
||||
id: '1'
|
||||
},
|
||||
valueAxis: 'ValueAxis-1',
|
||||
drawLinesBetweenPoints: true,
|
||||
showCircles: true
|
||||
}
|
||||
],
|
||||
seriesParams: [],
|
||||
addTooltip: true,
|
||||
addLegend: true,
|
||||
legendPosition: 'right',
|
||||
showCircles: true,
|
||||
interpolate: 'linear',
|
||||
scale: 'linear',
|
||||
drawLinesBetweenPoints: true,
|
||||
radiusRatio: 9,
|
||||
times: [],
|
||||
addTimeMarker: false,
|
||||
defaultYExtents: false,
|
||||
setYExtents: false
|
||||
},
|
||||
positions: ['top', 'left', 'right', 'bottom'],
|
||||
chartTypes: [{
|
||||
|
|
|
@ -15,6 +15,7 @@ export function VislibLibLayoutLayoutTypesProvider(Private) {
|
|||
return {
|
||||
pie: Private(VislibLibLayoutTypesPieLayoutProvider),
|
||||
gauge: Private(GaugeLayoutProvider),
|
||||
metric: Private(GaugeLayoutProvider),
|
||||
point_series: Private(VislibLibLayoutTypesColumnLayoutProvider)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ export function VislibTypesProvider(Private) {
|
|||
area: pointSeries.area,
|
||||
point_series: pointSeries.line,
|
||||
heatmap: pointSeries.heatmap,
|
||||
gauge: Private(vislibGaugeProvider)
|
||||
gauge: Private(vislibGaugeProvider),
|
||||
metric: Private(vislibGaugeProvider)
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,6 +15,7 @@ export function VislibVisualizationsVisTypesProvider(Private) {
|
|||
return {
|
||||
pie: Private(VislibVisualizationsPieChartProvider),
|
||||
point_series: Private(VislibVisualizationsPointSeriesProvider),
|
||||
gauge: Private(GaugeChartProvider)
|
||||
gauge: Private(GaugeChartProvider),
|
||||
metric: Private(GaugeChartProvider),
|
||||
};
|
||||
}
|
||||
|
|
|
@ -15,12 +15,15 @@ export function VislibVisTypeVislibVisTypeProvider(Private) {
|
|||
const pointSeries = Private(AggResponsePointSeriesProvider);
|
||||
const VislibRenderbot = Private(VislibVisTypeVislibRenderbotProvider);
|
||||
|
||||
// converts old config format (pre 5.2) to the new one
|
||||
const updateParams = function (params) {
|
||||
if (!params.seriesParams || !params.seriesParams.length) return;
|
||||
if (params.seriesParams && params.seriesParams.length) return;
|
||||
params.seriesParams = [{}];
|
||||
|
||||
const updateIfSet = (from, to, prop, func) => {
|
||||
if (from[prop]) {
|
||||
to[prop] = func ? func(from[prop]) : from[prop];
|
||||
delete from[prop];
|
||||
}
|
||||
};
|
||||
|
||||
|
@ -30,6 +33,10 @@ export function VislibVisTypeVislibVisTypeProvider(Private) {
|
|||
updateIfSet(params, params.seriesParams[0], 'interpolate');
|
||||
updateIfSet(params, params.seriesParams[0], 'type');
|
||||
|
||||
if (params.gauge) {
|
||||
updateIfSet(params, params.gauge.style, 'fontSize');
|
||||
}
|
||||
|
||||
if (params.mode) {
|
||||
const stacked = ['stacked', 'percentage', 'wiggle', 'silhouette'].includes(params.mode);
|
||||
params.seriesParams[0].mode = stacked ? 'stacked' : 'normal';
|
||||
|
@ -43,15 +50,19 @@ export function VislibVisTypeVislibVisTypeProvider(Private) {
|
|||
delete params.smoothLines;
|
||||
}
|
||||
|
||||
updateIfSet(params, params.valueAxes[0].scale, 'setYExtents');
|
||||
updateIfSet(params, params.valueAxes[0].scale, 'defaultYExtents');
|
||||
if (params.valueAxes) {
|
||||
updateIfSet(params, params.valueAxes[0].scale, 'setYExtents');
|
||||
updateIfSet(params, params.valueAxes[0].scale, 'defaultYExtents');
|
||||
}
|
||||
|
||||
if (params.scale) {
|
||||
params.valueAxes[0].scale.type = params.scale;
|
||||
delete params.scale;
|
||||
}
|
||||
|
||||
updateIfSet(params, params.categoryAxes[0], 'expandLastBucket');
|
||||
if (params.categoryAxis && params.categoryAxis.length) {
|
||||
updateIfSet(params, params.categoryAxes[0], 'expandLastBucket');
|
||||
}
|
||||
};
|
||||
|
||||
_.class(VislibVisType).inherits(VisType);
|
||||
|
@ -66,7 +77,7 @@ export function VislibVisTypeVislibVisTypeProvider(Private) {
|
|||
}
|
||||
|
||||
VislibVisType.prototype.createRenderbot = function (vis, $el, uiState) {
|
||||
updateParams(vis.params);
|
||||
if (vis.type.name !== 'pie') updateParams(vis.params);
|
||||
return new VislibRenderbot(vis, $el, uiState);
|
||||
};
|
||||
|
||||
|
|
|
@ -85,7 +85,7 @@ export function PointSeriesPageProvider({ getService }) {
|
|||
setGridValueAxis(axis) {
|
||||
return remote
|
||||
.setFindTimeout(defaultFindTimeout)
|
||||
.findByCssSelector(`select#gridAxis option[value="string:${axis}"]`)
|
||||
.findByCssSelector(`select#gridAxis option[value="${axis}"]`)
|
||||
.click();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue