AreaChart
基本使用
百分比面积图
垂直图表
可横向缩放图表
格式化 (一)
格式化 (二)
API
AreaChart 属性
<AreaChart {...props} /> 相当于 <VarietyChart type="area" {...props}/>。
VarietyChart 属性
| 参数 | 类型 | 默认值 |
|---|---|---|
| type? | 'line' | 'area' | 'bar' | 'composed' | 'pie' | - |
图表的类型,分别对应 | ||
| data? | ChartData | - |
数据源。 | ||
| useResponsiveContainer? | boolean | true |
是否使用响应式,开启的话浏览器窗口大小改变会响应式适应 | ||
| xAxisFormat? | string | - |
x轴 value 方式,内部做了处理,具体请看 getFormatValue。 | ||
| yAxisFormat? | string | - |
y轴 value 方式,内部做了处理,具体请看 getFormatValue。 | ||
| xAxisFormatter? | Formatter | - |
x轴 value 格式化函数。 | ||
| yAxisFormatter? | Formatter | - |
y轴 value 格式化函数。 | ||
| width? | number | - |
图表宽度,配合 recharts ResponsiveContainer 组件使用不需要设置。 | ||
| height? | number | 300 |
图表高度,配合 recharts ResponsiveContainer 组件使用不需要设置。 | ||
| layout? | 'horizontal' | 'vertical' | 'horizontal' |
图表布局方式,水平或者垂直。 | ||
| brush? | boolean | false |
图表是否可以横向缩放。 | ||
| stackOffset? | literal | - |