diff --git a/packages/charts/react-charting/src/components/AreaChart/AreaChart.base.tsx b/packages/charts/react-charting/src/components/AreaChart/AreaChart.base.tsx index 0f311abfae0f0..427b31ac821ad 100644 --- a/packages/charts/react-charting/src/components/AreaChart/AreaChart.base.tsx +++ b/packages/charts/react-charting/src/components/AreaChart/AreaChart.base.tsx @@ -42,11 +42,11 @@ import { formatDate, getSecureProps, areArraysEqual, + AreaChartModes, } from '../../utilities/index'; import { ILegend, Legends } from '../Legends/index'; import { DirectionalHint } from '@fluentui/react/lib/Callout'; import { IChart } from '../../types/index'; -import { AreaChartModes } from './AreaChart.types'; const getClassNames = classNamesFunction(); diff --git a/packages/charts/react-charting/src/components/AreaChart/AreaChart.types.ts b/packages/charts/react-charting/src/components/AreaChart/AreaChart.types.ts index 7ff9e86970c60..4e22679eb129d 100644 --- a/packages/charts/react-charting/src/components/AreaChart/AreaChart.types.ts +++ b/packages/charts/react-charting/src/components/AreaChart/AreaChart.types.ts @@ -14,21 +14,10 @@ import { ICartesianChartProps, IChildProps, } from '../CommonComponents/CartesianChart.types'; +import { AreaChartModes } from '../../utilities/utilities'; export type { IChildProps, IRefArrayData, IBasestate, ILineChartDataPoint, ILineChartPoints, IMargins }; -export enum AreaChartModes { - /** - * This mode will fill the area from the line to the x-axis. - */ - toZeroY = 'tozeroy', - - /** - * This mode will fill the area from the line to the next line. - */ - toNextY = 'tonexty', -} - /** * Area Chart properties. * {@docCategory AreaChart} diff --git a/packages/charts/react-charting/src/components/DeclarativeChart/PlotlySchemaAdapter.ts b/packages/charts/react-charting/src/components/DeclarativeChart/PlotlySchemaAdapter.ts index 5774eac00ea3b..f79ad0b452354 100644 --- a/packages/charts/react-charting/src/components/DeclarativeChart/PlotlySchemaAdapter.ts +++ b/packages/charts/react-charting/src/components/DeclarativeChart/PlotlySchemaAdapter.ts @@ -22,12 +22,13 @@ import { ISankeyChartProps } from '../SankeyChart/index'; import { IVerticalStackedBarChartProps } from '../VerticalStackedBarChart/index'; import { IHorizontalBarChartWithAxisProps } from '../HorizontalBarChartWithAxis/index'; import { ILineChartProps } from '../LineChart/index'; -import { AreaChartModes, IAreaChartProps } from '../AreaChart/index'; +import { IAreaChartProps } from '../AreaChart/index'; import { IHeatMapChartProps } from '../HeatMapChart/index'; import { DataVizPalette, getNextColor } from '../../utilities/colors'; import { GaugeChartVariant, IGaugeChartProps, IGaugeChartSegment } from '../GaugeChart/index'; import { IGroupedVerticalBarChartProps } from '../GroupedVerticalBarChart/index'; import { IVerticalBarChartProps } from '../VerticalBarChart/index'; +import { AreaChartModes } from '../../utilities/utilities'; const isDate = (value: any): boolean => !isNaN(Date.parse(value)); const isNumber = (value: any): boolean => !isNaN(parseFloat(value)) && isFinite(value); diff --git a/packages/charts/react-charting/src/utilities/utilities.ts b/packages/charts/react-charting/src/utilities/utilities.ts index 735024e852f98..a6557936b11aa 100644 --- a/packages/charts/react-charting/src/utilities/utilities.ts +++ b/packages/charts/react-charting/src/utilities/utilities.ts @@ -68,6 +68,18 @@ export enum YAxisType { StringAxis, } +export enum AreaChartModes { + /** + * This mode will fill the area from the line to the x-axis. + */ + toZeroY = 'tozeroy', + + /** + * This mode will fill the area from the line to the next line. + */ + toNextY = 'tonexty', +} + export interface IWrapLabelProps { node: SVGSVGElement | null; xAxis: NumericAxis | StringAxis; diff --git a/packages/react-examples/src/react-charting/AreaChart/AreaChart.Basic.Example.tsx b/packages/react-examples/src/react-charting/AreaChart/AreaChart.Basic.Example.tsx index e3990fe6d58b8..0cfdc05cb8300 100644 --- a/packages/react-examples/src/react-charting/AreaChart/AreaChart.Basic.Example.tsx +++ b/packages/react-examples/src/react-charting/AreaChart/AreaChart.Basic.Example.tsx @@ -3,7 +3,7 @@ import { AreaChart, ICustomizedCalloutData } from '@fluentui/react-charting'; import { IAreaChartProps, ChartHoverCard, DataVizPalette, getColorFromToken } from '@fluentui/react-charting'; import { ChoiceGroup, IChoiceGroupOption } from '@fluentui/react/lib/ChoiceGroup'; import { Toggle } from '@fluentui/react/lib/Toggle'; -import { AreaChartModes } from '@fluentui/react-charting/lib/AreaChart'; +import { AreaChartModes } from '@fluentui/react-charting/lib/utilities/utilities'; interface IAreaChartBasicState { width: number;