Skip to content

Commit 17fd148

Browse files
committed
Scatter chart: added new placeholder
1 parent 5cce9e0 commit 17fd148

File tree

4 files changed

+37
-3
lines changed

4 files changed

+37
-3
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import { ThemingParameters } from '@ui5/webcomponents-react-base/lib/ThemingParameters';
2+
import React from 'react';
3+
import ContentLoader from 'react-content-loader';
4+
5+
export const ScatterChartPlaceholder = (props) => {
6+
return (
7+
<ContentLoader
8+
viewBox="0 0 165 145"
9+
preserveAspectRatio="xMidYMid meet"
10+
width="100%"
11+
height="100%"
12+
speed={2}
13+
backgroundColor={ThemingParameters.sapContent_ImagePlaceholderBackground}
14+
foregroundColor={ThemingParameters.sapContent_ImagePlaceholderForegroundColor}
15+
backgroundOpacity={ThemingParameters.sapContent_DisabledOpacity as any}
16+
{...props}
17+
>
18+
<rect x="10" y="135" width="135" height="1" />
19+
<circle cx="20" cy="90" r="2" />
20+
<circle cx="40" cy="58" r="3" />
21+
<circle cx="60" cy="108" r="14" />
22+
<circle cx="85" cy="87" r="8" />
23+
<circle cx="105" cy="50" r="6" />
24+
<circle cx="125" cy="115" r="4" />
25+
<circle cx="78" cy="58" r="10" />
26+
<circle cx="28" cy="115" r="4" />
27+
</ContentLoader>
28+
);
29+
};

packages/charts/src/components/ScatterChart/ScatterChart.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { enrichEventWithDetails } from '@ui5/webcomponents-react-base/lib/Utils'
44
import { ChartContainer } from '@ui5/webcomponents-react-charts/lib/components/ChartContainer';
55
import { XAxisTicks } from '@ui5/webcomponents-react-charts/lib/components/XAxisTicks';
66
import { YAxisTicks } from '@ui5/webcomponents-react-charts/lib/components/YAxisTicks';
7-
import { LineChartPlaceholder } from '@ui5/webcomponents-react-charts/lib/LineChartPlaceholder';
7+
import { ScatterChartPlaceholder } from '@ui5/webcomponents-react-charts/lib/ScatterChartPlaceholder';
88
import { useLegendItemClick } from '@ui5/webcomponents-react-charts/lib/useLegendItemClick';
99
import React, { CSSProperties, FC, forwardRef, Ref, useCallback, useMemo } from 'react';
1010
import {
@@ -177,7 +177,7 @@ const ScatterChart: FC<ScatterChartProps> = forwardRef((props: ScatterChartProps
177177
<ChartContainer
178178
dataset={dataset}
179179
loading={loading}
180-
Placeholder={LineChartPlaceholder}
180+
Placeholder={ScatterChartPlaceholder}
181181
ref={chartRef}
182182
style={style}
183183
className={className}

packages/charts/src/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import { PieChartPlaceholder } from './lib/PieChartPlaceholder';
1212
import { RadarChart } from './lib/RadarChart';
1313
import { RadialChart } from './lib/RadialChart';
1414
import { ScatterChart } from './lib/ScatterChart';
15+
import { ScatterChartPlaceholder } from './lib/ScatterChartPlaceholder';
1516

1617
export {
1718
ColumnChart,
@@ -26,5 +27,6 @@ export {
2627
BarChartPlaceholder,
2728
ColumnChartPlaceholder,
2829
LineChartPlaceholder,
29-
PieChartPlaceholder
30+
PieChartPlaceholder,
31+
ScatterChartPlaceholder
3032
};
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { ScatterChartPlaceholder } from '../components/ScatterChart/Placeholder';
2+
3+
export { ScatterChartPlaceholder };

0 commit comments

Comments
 (0)