Skip to content

Commit

Permalink
Fix issue with Kibana Icon in Uptime App (#56837)
Browse files Browse the repository at this point in the history
  • Loading branch information
shahzad31 authored Feb 6, 2020
1 parent 335d784 commit bb6dac4
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,20 @@ export const DonutChart = ({ height, down, up, width }: DonutChartProps) => {
useEffect(() => {
if (chartElement.current !== null) {
// we must remove any existing paths before painting
d3.selectAll('g').remove();
d3.select(chartElement.current)
.selectAll('g')
.remove();

const svgElement = d3
.select(chartElement.current)
.append('g')
.attr('transform', `translate(${width / 2}, ${height / 2})`);

const color = d3.scale
.ordinal()
.domain(['up', 'down'])
.range([gray, danger]);

const pieGenerator = d3.layout
.pie()
.value(({ value }: any) => value)
Expand Down Expand Up @@ -69,6 +74,7 @@ export const DonutChart = ({ height, down, up, width }: DonutChartProps) => {
.attr('fill', (d: any) => color(d.data.key));
}
}, [danger, down, gray, height, upCount, width]);

return (
<EuiFlexGroup alignItems="center" responsive={false}>
<EuiFlexItem grow={false}>
Expand Down

0 comments on commit bb6dac4

Please sign in to comment.