diff --git a/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.cy.tsx b/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.cy.tsx index b723fdbedfe..b7b861daf02 100644 --- a/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.cy.tsx +++ b/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.cy.tsx @@ -85,6 +85,29 @@ describe('ColumnChartWithTrend', () => { cy.contains('Loading...').should('exist'); }); + it('in Grid', () => { + cy.mount( +
+ +
+ ); + + cy.findByTestId('ccwt').should('be.visible').invoke('prop', 'offsetHeight').should('eq', 500); + cy.findByTestId('ccwt').invoke('prop', 'offsetWidth').should('eq', 500); + }); + testChartZoomingTool(ColumnChartWithTrend, { dataset: complexDataSet, dimensions, measures }); testChartLegendConfig(ColumnChartWithTrend, { dataset: complexDataSet, dimensions, measures }); diff --git a/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.module.css b/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.module.css new file mode 100644 index 00000000000..8ff0bb3c6d7 --- /dev/null +++ b/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.module.css @@ -0,0 +1,23 @@ +.container { + /*ChartContainer styles*/ + font-size: var(--sapFontSmallSize); + color: var(--sapTextColor); + font-family: var(--sapFontFamily); + width: 100%; + height: 400px; + min-height: fit-content; + position: relative; + + display: flex; + flex-direction: column; +} + +.trendContainer { + height: auto; + flex: 0 0 20%; +} + +.chartContainer { + height: auto; + flex-grow: 1; +} diff --git a/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.tsx b/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.tsx index 929f0a9d5ec..5107d8314c7 100644 --- a/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.tsx +++ b/packages/charts/src/components/ColumnChartWithTrend/ColumnChartWithTrend.tsx @@ -1,6 +1,7 @@ 'use client'; -import { ThemingParameters } from '@ui5/webcomponents-react-base'; +import { ThemingParameters, useStylesheet } from '@ui5/webcomponents-react-base'; +import { clsx } from 'clsx'; import type { CSSProperties } from 'react'; import { forwardRef, useId } from 'react'; import type { TooltipProps, YAxisProps } from 'recharts'; @@ -13,6 +14,7 @@ import type { IChartDimension } from '../../interfaces/IChartDimension.js'; import type { IChartMeasure } from '../../interfaces/IChartMeasure.js'; import { defaultFormatter } from '../../internal/defaults.js'; import { ComposedChart } from '../ComposedChart/index.js'; +import { classNames, content } from './ColumnChartWithTrend.module.css.js'; import { ColumnChartWithTrendPlaceholder } from './Placeholder.js'; interface MeasureConfig extends IChartMeasure { @@ -111,9 +113,7 @@ const ColumnChartWithTrend = forwardRef +
{dataset?.length !== 0 && ( )}
);