@manta-eu/react/chart
Reference for @manta-eu/react/chart as it is on main.
Type Aliases
AreaChartProps
AreaChartProps =
object
Properties
data
data:
AreaChartData
BarChartProps
BarChartProps =
object
Properties
data
data:
BarChartData
ChartConfig
ChartConfig = { [k in string]: { icon?: ComponentType; label?: ReactNode } & ({ color?: string; theme?: never } | { color?: never; theme: Record<keyof typeof themes, string> }) }
ChartContainerProps
ChartContainerProps =
ComponentProps<"div"> &object
Type Declaration
children
children:
ComponentProps<typeofResponsiveContainer>["children"]
config
config:
ChartConfig
ChartFrameProps
ChartFrameProps =
object
Properties
children
children:
ReactElement
className?
optionalclassName?:string
config
config:
ChartConfig
height?
optionalheight?:number
title?
optionaltitle?:string
ChartLegendContentProps
ChartLegendContentProps =
ComponentProps<"div"> &Pick<LegendProps,"payload"|"verticalAlign"> &object
Type Declaration
hideIcon?
optionalhideIcon?:boolean
nameKey?
optionalnameKey?:string
ChartStyleProps
ChartStyleProps =
object
Properties
config
config:
ChartConfig
id
id:
string
CHartToolTipContentProps
CHartToolTipContentProps =
ComponentProps<typeofTooltip> &ComponentProps<"div"> &object
Type Declaration
hideIndicator?
optionalhideIndicator?:boolean
hideLabel?
optionalhideLabel?:boolean
indicator?
optionalindicator?:"line"|"dot"|"dashed"
labelKey?
optionallabelKey?:string
nameKey?
optionalnameKey?:string
ComposedChartProps
ComposedChartProps =
object
Properties
data
data:
ComposedChartData
ForecastBetween
ForecastBetween =
object
Properties
from
from:
string
label
label:
string
to
to:
string
ForecastChartProps
ForecastChartProps =
object
Properties
between?
optionalbetween?:ForecastBetween[]
A faint fill between two metrics, such as profit between revenue and costs.
changeLabel?
optionalchangeLabel?:string
Follows the signed gap in the hover card: “+$2,664 with the plans”.
className?
optionalclassName?:string
data
data:
Record<string,unknown>[]
One row per x value; each row carries x and a number per metric key.
events?
optionalevents?:ForecastEvent[]
formatDetail?
optionalformatDetail?: (value) =>string
Formats the figures in the hover card.
Parameters
value
number
Returns
string
formatValue?
optionalformatValue?: (value) =>string
Formats axis ticks.
Parameters
value
number
Returns
string
gainLabel?
optionalgainLabel?:string
Legend name of the shading between a metric and its withoutPlans line.
goal?
optionalgoal?:object
label
label:
string
value
value:
number
height?
optionalheight?:number
legendLabels?
optionallegendLabels?:object
Legend names of the solid and dotted parts of a single metric.
historic?
optionalhistoric?:string
projected?
optionalprojected?:string
metrics
metrics:
ForecastMetric[]
onEventSelect?
optionalonEventSelect?: (event) =>void
Called when an event’s dot or its card link is chosen; without it, an event’s href is a plain link.
Parameters
event
Returns
void
planShares?
optionalplanShares?:ForecastPlanShare[]
The plans behind each projected point of a metric, shown in its hover card (the first two).
projectedLabel?
optionalprojectedLabel?:string
title?
optionaltitle?:string
today?
optionaltoday?:string|number
The x value of Today: lines are solid up to it and dotted after. Omit it for a history-only chart.
todayLabel?
optionaltodayLabel?:string
The tag on the Today line.
ForecastEvent
ForecastEvent =
object
An action already applied (a filled dot) or a plan waiting for approval (a hollow dot), on a metric’s line.
Properties
href?
optionalhref?:string
Rendered as a plain link in the card (and on the dot when the chart has no onEventSelect).
label?
optionallabel?:string
The small line above the title; defaults to “Applied” or “Waiting for your approval”.
linkLabel?
optionallinkLabel?:string
metric
metric:
string
status
status:
"applied"|"waiting"
title
title:
string
value?
optionalvalue?:string
valueNote?
optionalvalueNote?:string
x
x:
string|number
ForecastMetric
ForecastMetric =
object
Properties
color?
optionalcolor?:string
key
key:
string
label
label:
string
lowerIsBetter?
optionallowerIsBetter?:boolean
For costs: a drop with the plans shows as a gain in the hover card.
withoutPlans?
optionalwithoutPlans?:object
The same metric if the plans are not approved; the gap between the two is shaded as what the plans add.
key
key:
string
label
label:
string
ForecastPlanShare
ForecastPlanShare =
object
The plans behind one metric’s projected value at one point, as the chart’s data carries them.
Properties
metric
metric:
string
plans
plans:
ForecastPointPlan[]
x
x:
string|number
ForecastPointPlan
ForecastPointPlan =
object
Properties
label
label:
string
value
value:
number
LineChartProps
LineChartProps =
object
Properties
data
data:
LineChartData
PieChartProps
PieChartProps =
object
Properties
data
data:
PieChartData
RadarChartProps
RadarChartProps =
object
Properties
data
data:
RadarChartData
ScatterChartProps
ScatterChartProps =
object
Properties
data
data:
ScatterChartData
Selector
Selector =
string
Theme
Theme =
"light"|"dark"
Variables
ChartLegend
constChartLegend: typeofLegend=Legend
ChartTooltip
constChartTooltip: typeofTooltip=Tooltip
themes
Functions
AreaChart()
AreaChart(
props):Element
Parameters
props
Returns
Element
BarChart()
BarChart(
props):Element
Parameters
props
Returns
Element
chartColorAt()
chartColorAt(
index):string
Parameters
index
number
Returns
string
ChartContainer()
ChartContainer(
props):Element
Parameters
props
Returns
Element
ChartFrame()
ChartFrame(
props):Element
Parameters
props
Returns
Element
ChartLegendContent()
ChartLegendContent(
props):Element|null
Parameters
props
Returns
Element | null
ChartStyle()
ChartStyle(
props):Element|null
Parameters
props
Returns
Element | null
ChartTooltipContent()
ChartTooltipContent(
props):Element|null
Parameters
props
Returns
Element | null
ComposedChart()
ComposedChart(
props):Element
Parameters
props
Returns
Element
ForecastChart()
ForecastChart(
props):Element
Parameters
props
Returns
Element
LineChart()
LineChart(
props):Element
Parameters
props
Returns
Element
PieChart()
PieChart(
props):Element
Parameters
props
Returns
Element
RadarChart()
RadarChart(
props):Element
Parameters
props
Returns
Element
ScatterChart()
ScatterChart(
props):Element
Parameters
props
Returns
Element