File tree Expand file tree Collapse file tree
src/platform/packages/shared/kbn-lens-embeddable-utils/config_builder/transforms Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -305,7 +305,8 @@ function buildDatasourceStatesLayer(
305305 ds : NarrowByType < DatasetType , 'table' >
306306 ) : TextBasedPersistedState [ 'layers' ] [ 0 ] {
307307 const table = ds . table as LensDatatableDataset ;
308- const xAxisScale = 'axis' in fullConfig ? fullConfig . axis ?. x ?. scale : undefined ;
308+ const xAxisScale =
309+ fullConfig . type === 'xy' && fullConfig . axis ?. x ? fullConfig . axis . x . scale : undefined ;
309310 const newLayer = {
310311 table,
311312 columns : getValueColumns ( config , i , xAxisScale ) ,
@@ -327,7 +328,8 @@ function buildDatasourceStatesLayer(
327328 config : unknown ,
328329 ds : NarrowByType < DatasetType , 'esql' >
329330 ) : TextBasedPersistedState [ 'layers' ] [ 0 ] {
330- const xAxisScale = 'axis' in fullConfig ? fullConfig . axis ?. x ?. scale : undefined ;
331+ const xAxisScale =
332+ fullConfig . type === 'xy' && fullConfig . axis ?. x ? fullConfig . axis . x . scale : undefined ;
331333 const columns = getValueColumns ( config , i , xAxisScale ) ;
332334
333335 return {
You can’t perform that action at this time.
0 commit comments