Skip to content

Commit

Permalink
styling (elastic#132539)
Browse files Browse the repository at this point in the history
Co-authored-by: Kibana Machine <42973632+kibanamachine@users.noreply.github.com>
  • Loading branch information
angorayc and kibanamachine committed May 23, 2022
1 parent a807c90 commit bdb4966
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {

import { getOr, get, isNull, isNumber } from 'lodash/fp';

import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EuiFlexItem } from '@elastic/eui';
import { useThrottledResizeObserver } from '../utils';
import { ChartPlaceHolder } from './chart_place_holder';
import { useTimeZone } from '../../lib/kibana';
Expand All @@ -32,6 +32,7 @@ import {
WrappedByAutoSizer,
useTheme,
Wrapper,
ChartWrapper,
} from './common';
import { VisualizationActions, HISTOGRAM_ACTIONS_BUTTON_CLASS } from '../visualization_actions';
import { VisualizationActionsProps } from '../visualization_actions/types';
Expand Down Expand Up @@ -165,7 +166,7 @@ export const AreaChartComponent: React.FC<AreaChartComponentProps> = ({
<Wrapper>
<HoverVisibilityContainer targetClassNames={[HISTOGRAM_ACTIONS_BUTTON_CLASS]}>
{isValidSeriesExist && areaChart && (
<EuiFlexGroup gutterSize="none">
<ChartWrapper gutterSize="none">
<EuiFlexItem grow={true}>
<WrappedByAutoSizer ref={measureRef} height={chartHeight}>
<AreaChartBase
Expand All @@ -176,7 +177,7 @@ export const AreaChartComponent: React.FC<AreaChartComponentProps> = ({
/>
</WrappedByAutoSizer>
</EuiFlexItem>
</EuiFlexGroup>
</ChartWrapper>
)}
{!isValidSeriesExist && (
<ChartPlaceHolder height={chartHeight} width={chartWidth} data={areaChart} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* 2.0.
*/

import { EuiFlexGroup, EuiFlexItem } from '@elastic/eui';
import { EuiFlexItem } from '@elastic/eui';
import React, { useMemo } from 'react';
import { Chart, BarSeries, Axis, Position, ScaleType, Settings } from '@elastic/charts';
import { getOr, get, isNumber } from 'lodash/fp';
Expand All @@ -32,6 +32,7 @@ import {
WrappedByAutoSizer,
useTheme,
Wrapper,
ChartWrapper,
} from './common';
import { DraggableLegend } from './draggable_legend';
import { LegendItem } from './draggable_legend_item';
Expand Down Expand Up @@ -210,7 +211,7 @@ export const BarChartComponent: React.FC<BarChartComponentProps> = ({
<Wrapper>
<HoverVisibilityContainer targetClassNames={[HISTOGRAM_ACTIONS_BUTTON_CLASS]}>
{isValidSeriesExist && barChart && (
<EuiFlexGroup gutterSize="none">
<ChartWrapper gutterSize="none">
<EuiFlexItem grow={true}>
<WrappedByAutoSizer ref={measureRef} height={chartHeight}>
<BarChartBase
Expand All @@ -227,7 +228,7 @@ export const BarChartComponent: React.FC<BarChartComponentProps> = ({
<LegendFlexItem grow={false}>
<DraggableLegend legendItems={legendItems} height={height} />
</LegendFlexItem>
</EuiFlexGroup>
</ChartWrapper>
)}
{!isValidSeriesExist && (
<ChartPlaceHolder height={chartHeight} width={chartWidth} data={barChart} />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import {
AxisStyle,
BarSeriesStyle,
} from '@elastic/charts';
import { EuiFlexGroup } from '@elastic/eui';
import React, { useMemo } from 'react';
import styled from 'styled-components';

Expand Down Expand Up @@ -152,3 +153,7 @@ export const checkIfAllValuesAreZero = (data: ChartSeriesData[] | null | undefin
export const Wrapper = styled.div`
position: relative;
`;

export const ChartWrapper = styled(EuiFlexGroup)`
z-index: 0;
`;
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ const Wrapper = styled.div`
position: absolute;
top: 0;
right: 0;
z-index: 1;
}
&.histogram-viz-actions {
padding: ${({ theme }) => theme.eui.paddingSizes.s};
Expand Down

0 comments on commit bdb4966

Please sign in to comment.