Skip to content

Commit 168dd26

Browse files
committed
Added support of assign color
1 parent ca791a9 commit 168dd26

File tree

2 files changed

+5
-1
lines changed
  • packages/kbn-optimizer
  • src/plugins/vis_types/xy/public/convert_to_lens/configurations

2 files changed

+5
-1
lines changed

packages/kbn-optimizer/limits.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,6 @@ pageLoadAssetSize:
140140
visTypeTimeseries: 55203
141141
visTypeVega: 153573
142142
visTypeVislib: 242838
143-
visTypeXy: 31300
143+
visTypeXy: 31600
144144
visualizations: 90000
145145
watcher: 43598

src/plugins/vis_types/xy/public/convert_to_lens/configurations/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ function getDataLayers(
111111
series: SeriesParam[],
112112
vis: Vis<VisParams>
113113
): XYDataLayerConfig[] {
114+
const overwriteColors: Record<string, string> = vis.uiState.get('vis.colors', {});
114115
return layers.map((layer) => {
115116
const xColumn = layer.columns.find((c) => c.isBucketed && !c.isSplit);
116117
const splitAccessor = layer.columns.find(
@@ -133,6 +134,7 @@ function getDataLayers(
133134
isHorizontal,
134135
isPercentage
135136
);
137+
136138
return {
137139
layerId: layer.layerId,
138140
accessors: layer.metrics,
@@ -150,6 +152,8 @@ function getDataLayers(
150152
return {
151153
forAccessor: metricId,
152154
axisMode: getYAxisPosition(yAxis?.position ?? 'left'),
155+
color:
156+
!splitAccessor && serie?.data.label ? overwriteColors[serie?.data.label] : undefined,
153157
};
154158
}),
155159
xScaleType: getXScaleType(xColumn),

0 commit comments

Comments
 (0)