@@ -15,6 +15,7 @@ import {
1515 EuiColorPicker ,
1616 EuiColorPickerProps ,
1717 EuiToolTip ,
18+ EuiIcon ,
1819} from '@elastic/eui' ;
1920import { State , SeriesType , visualizationTypes , YAxisMode } from './types' ;
2021import { VisualizationDimensionEditorProps , VisualizationLayerWidgetProps } from '../types' ;
@@ -90,15 +91,8 @@ export function DimensionEditor(props: VisualizationDimensionEditorProps<State>)
9091
9192 return (
9293 < EuiForm >
93- < EuiFormRow
94- display = "columnCompressed"
95- fullWidth
96- label = { i18n . translate ( 'xpack.lens.xyChart.seriesColor.label' , {
97- defaultMessage : 'Series color' ,
98- } ) }
99- >
100- < ColorPicker { ...props } />
101- </ EuiFormRow >
94+ < ColorPicker { ...props } />
95+
10296 < EuiFormRow
10397 display = "columnCompressed"
10498 fullWidth
@@ -211,23 +205,46 @@ const ColorPicker = ({
211205 ) ;
212206
213207 return (
214- < EuiToolTip
215- position = "top"
216- content = {
217- disabled ? tooltipContent . disabled : color ? tooltipContent . custom : tooltipContent . auto
208+ < EuiFormRow
209+ display = "columnCompressed"
210+ fullWidth
211+ label = {
212+ < EuiToolTip
213+ delay = "long"
214+ position = "top"
215+ content = { color && ! disabled ? tooltipContent . custom : tooltipContent . auto }
216+ >
217+ < span >
218+ { i18n . translate ( 'xpack.lens.xyChart.seriesColor.label' , {
219+ defaultMessage : 'Series color' ,
220+ } ) } { ' ' }
221+ < EuiIcon type = "questionInCircle" color = "subdued" />
222+ </ span >
223+ </ EuiToolTip >
218224 }
219- delay = "long"
220- anchorClassName = "eui-displayBlock"
221225 >
222- < EuiColorPicker
223- compressed
224- onChange = { handleColor }
225- color = { disabled ? '' : color }
226- disabled = { disabled }
227- aria-label = { i18n . translate ( 'xpack.lens.xyChart.seriesColor.label' , {
228- defaultMessage : 'Series color' ,
229- } ) }
230- />
231- </ EuiToolTip >
226+ { disabled ? (
227+ < EuiToolTip position = "top" content = { tooltipContent . disabled } delay = "long" >
228+ < EuiColorPicker
229+ compressed
230+ onChange = { handleColor }
231+ color = ""
232+ disabled
233+ aria-label = { i18n . translate ( 'xpack.lens.xyChart.seriesColor.label' , {
234+ defaultMessage : 'Series color' ,
235+ } ) }
236+ />
237+ </ EuiToolTip >
238+ ) : (
239+ < EuiColorPicker
240+ compressed
241+ onChange = { handleColor }
242+ color = { color }
243+ aria-label = { i18n . translate ( 'xpack.lens.xyChart.seriesColor.label' , {
244+ defaultMessage : 'Series color' ,
245+ } ) }
246+ />
247+ ) }
248+ </ EuiFormRow >
232249 ) ;
233250} ;
0 commit comments