File tree Expand file tree Collapse file tree 2 files changed +4
-0
lines changed
dashboard/src/components/plugins/viz-components Expand file tree Collapse file tree 2 files changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -5,10 +5,12 @@ import { ICartesianChartConf } from '../type';
55export function getXAxes ( conf : ICartesianChartConf , xAxisData : $TSFixMe [ ] ) {
66 const { overflow, ...axisLabel } = conf . x_axis . axisLabel ;
77 const overflowOption = getLabelOverflowOptionOnAxis ( overflow . on_axis ) ;
8+ const xDataEmpty = xAxisData . length === 0 ;
89 return [
910 {
1011 data : xAxisData ,
1112 name : conf . x_axis_name ?? '' ,
13+ nameGap : xDataEmpty ? 5 : undefined ,
1214 id : 'main-x-axis' ,
1315 axisTick : {
1416 show : true ,
Original file line number Diff line number Diff line change @@ -4,10 +4,12 @@ import { IScatterChartConf } from '../type';
44export function getXAxes ( conf : IScatterChartConf , xAxisData : $TSFixMe [ ] ) {
55 const allNumbers = xAxisData . every ( ( d ) => ! Number . isNaN ( Number ( d ) ) ) ;
66 const { axisLabel } = conf . x_axis ;
7+ const xDataEmpty = xAxisData . length === 0 ;
78 return [
89 {
910 data : xAxisData ,
1011 name : conf . x_axis . name ?? '' ,
12+ nameGap : xDataEmpty ? 5 : undefined ,
1113 id : 'main-x-axis' ,
1214 axisTick : {
1315 show : true ,
You can’t perform that action at this time.
0 commit comments