滚动条 - ScrollBar
上一篇
标注 - Guide
Loading...
数据滚动和缩放
import { Canvas, Chart, Line, ScrollBar } from '@antv/f2';const data = [{ genre: 'Sports', sold: 5 },{ genre: 'Strategy', sold: 10 },{ genre: 'Action', sold: 20 },{ genre: 'Shooter', sold: 20 },{ genre: 'Other', sold: 40 },];<Canvas context={context}><Chart data={data}><Axis field="genre" /><Line x="genre" y="sold" /><ScrollBar /></Chart></Canvas>;
滚动模式,默认为: 'x'
, 可选值: 'x' | 'y' | '['x', 'y']'
初始化区间, 默认为: [0, 1]
,数值为 0 ~ 1
之间
是否支持平移,默认为: true
是否支持缩放,默认为: true
自动同步 x/y 的坐标值,默认为:false
是否显示滚动条
默认为 'bottom'
, 可选值为:'top' | 'right' | 'bottom' | 'left'
滚动条和图表内容间距,比如
marign: ['10px', '20px']marignTop: '10px'
滚动条背景样式
类型为绘图属性:线条属性 线条样式
滑块样式
类型为绘图属性:线条属性 线条样式