UI: Time series charts improvements
This commit is contained in:
parent
63b827e953
commit
02648dd4a5
@ -417,8 +417,8 @@ export const adjustTimeAxisExtentToData = (timeAxisOption: TimeAxisBaseOption,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
timeAxisOption.min = (typeof min !== 'undefined') ? min : defaultMin;
|
timeAxisOption.min = (typeof min !== 'undefined' && Math.abs(min - defaultMin) < 1000) ? min : defaultMin;
|
||||||
timeAxisOption.max = (typeof max !== 'undefined') ? max : defaultMax;
|
timeAxisOption.max = (typeof max !== 'undefined' && Math.abs(max - defaultMax) < 1000) ? max : defaultMax;
|
||||||
};
|
};
|
||||||
|
|
||||||
const toEChartsDataItem = (entry: DataEntry, valueConverter?: (value: any) => any): EChartsDataItem => {
|
const toEChartsDataItem = (entry: DataEntry, valueConverter?: (value: any) => any): EChartsDataItem => {
|
||||||
|
|||||||
@ -128,7 +128,8 @@ export const renderTimeSeriesBar = (params: CustomSeriesRenderItemParams, api: C
|
|||||||
height: coordSys.height
|
height: coordSys.height
|
||||||
});
|
});
|
||||||
|
|
||||||
const zeroPos = api.coord([0, offset]);
|
const zeroCoord = api.coord([0, offset]);
|
||||||
|
const zeroPos = Math.min(zeroCoord[1], coordSys.y + coordSys.height);
|
||||||
|
|
||||||
let style: any = {
|
let style: any = {
|
||||||
fill: renderCtx.visualSettings.color,
|
fill: renderCtx.visualSettings.color,
|
||||||
@ -176,7 +177,7 @@ export const renderTimeSeriesBar = (params: CustomSeriesRenderItemParams, api: C
|
|||||||
transition: 'all',
|
transition: 'all',
|
||||||
enterFrom: {
|
enterFrom: {
|
||||||
style: { opacity: 0 },
|
style: { opacity: 0 },
|
||||||
shape: { height: 0, y: zeroPos[1] }
|
shape: { height: 0, y: zeroPos }
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
@ -803,9 +803,13 @@ export class TbTimeSeriesChart {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private scaleYAxis(yAxis: TimeSeriesChartYAxis): boolean {
|
private scaleYAxis(yAxis: TimeSeriesChartYAxis): boolean {
|
||||||
|
if (!this.stateData) {
|
||||||
const axisBarDataItems = this.dataItems.filter(d => d.yAxisId === yAxis.id && d.enabled &&
|
const axisBarDataItems = this.dataItems.filter(d => d.yAxisId === yAxis.id && d.enabled &&
|
||||||
d.data.length && d.dataKey.settings.type === TimeSeriesChartSeriesType.bar);
|
d.data.length && d.dataKey.settings.type === TimeSeriesChartSeriesType.bar);
|
||||||
return !axisBarDataItems.length;
|
return !axisBarDataItems.length;
|
||||||
|
} else {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private minTopOffset(): number {
|
private minTopOffset(): number {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user