mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
GraphNG: remove y-axis position control from series color picker in the legend (#30302)
This commit is contained in:
parent
c14c7b6874
commit
a94c256516
@ -12,11 +12,9 @@ export interface SeriesColorPickerPopoverProps extends ColorPickerProps, Popover
|
||||
|
||||
export const SeriesColorPickerPopover: FunctionComponent<SeriesColorPickerPopoverProps> = props => {
|
||||
const { yaxis, onToggleAxis, color, ...colorPickerProps } = props;
|
||||
return (
|
||||
<ColorPickerPopover
|
||||
{...colorPickerProps}
|
||||
color={color || '#000000'}
|
||||
customPickers={{
|
||||
|
||||
const customPickers = onToggleAxis
|
||||
? {
|
||||
yaxis: {
|
||||
name: 'Y-Axis',
|
||||
tabComponent() {
|
||||
@ -36,9 +34,9 @@ export const SeriesColorPickerPopover: FunctionComponent<SeriesColorPickerPopove
|
||||
);
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
: undefined;
|
||||
return <ColorPickerPopover {...colorPickerProps} color={color || '#000000'} customPickers={customPickers} />;
|
||||
};
|
||||
|
||||
interface AxisSelectorProps {
|
||||
|
@ -27,7 +27,6 @@ export const VizLegendListItem: React.FunctionComponent<Props> = ({ item, onSeri
|
||||
onSeriesColorChange(item.label, color);
|
||||
}
|
||||
}}
|
||||
yAxis={item.yAxis}
|
||||
/>
|
||||
<div
|
||||
onClick={event => {
|
||||
|
@ -5,28 +5,14 @@ import { SeriesIcon } from './SeriesIcon';
|
||||
interface Props {
|
||||
disabled: boolean;
|
||||
color: string;
|
||||
yAxis: number;
|
||||
onColorChange: (color: string) => void;
|
||||
onToggleAxis?: () => void;
|
||||
}
|
||||
|
||||
export const VizLegendSeriesIcon: React.FunctionComponent<Props> = ({
|
||||
disabled,
|
||||
yAxis,
|
||||
color,
|
||||
onColorChange,
|
||||
onToggleAxis,
|
||||
}) => {
|
||||
export const VizLegendSeriesIcon: React.FunctionComponent<Props> = ({ disabled, color, onColorChange }) => {
|
||||
return disabled ? (
|
||||
<SeriesIcon color={color} />
|
||||
) : (
|
||||
<SeriesColorPicker
|
||||
yaxis={yAxis}
|
||||
color={color}
|
||||
onChange={onColorChange}
|
||||
onToggleAxis={onToggleAxis}
|
||||
enableNamedColors
|
||||
>
|
||||
<SeriesColorPicker color={color} onChange={onColorChange} enableNamedColors>
|
||||
{({ ref, showColorPicker, hideColorPicker }) => (
|
||||
<SeriesIcon
|
||||
color={color}
|
||||
|
@ -35,7 +35,6 @@ export const LegendTableItem: React.FunctionComponent<Props> = ({
|
||||
onSeriesColorChange(item.label, color);
|
||||
}
|
||||
}}
|
||||
yAxis={item.yAxis}
|
||||
/>
|
||||
<div
|
||||
onClick={event => {
|
||||
|
Loading…
Reference in New Issue
Block a user