:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
import { ChartSettings } from '~/queries/schema/schema-general'
import { ChartDisplayType } from '~/types'
import { AxisSeries } from '../../dataVisualizationLogic'
import { AxisBreakdownSeries } from '../seriesBreakdownLogic'
import { SqlChartProps } from './SqlChart'
import { SqlPieGraph } from './SqlPieGraph'
import { SqlProportionBar } from './SqlProportionBar'
export interface PartOfWholeChartProps {
labelFormatter?: (label: string) => string
xData: AxisSeries<string> | null
yData: AxisSeries<number | null>[] | AxisBreakdownSeries<number | null>[]
visualizationType: ChartDisplayType
chartSettings: ChartSettings
presetChartHeight?: boolean
className?: string
onSliceClick?: SqlChartProps['onSliceClick']
}
export function PartOfWholeChart(props: PartOfWholeChartProps): JSX.Element {
return props.visualizationType === ChartDisplayType.ActionsProportionBar ? (
<SqlProportionBar {...props} />
) : (
<SqlPieGraph {...props} />
)
}