1.0.5 • Published 2 years ago

@castianta/chart-lc v1.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

lightningchart 版曲图表库

@castianta/chart-lc

图表公共 API

API

参数名说明必填类型默认值备注
card面板ProCardProps--
dataSource数据源ObjectDataSourceProps-单个图形有说明
legend图例LegendProps-见下
init初始化图表配置参数InitProps-见下
chartConfig图表配置ChartConfigProps-见下
chart3D2D 3D 切换Booleanfalse-
xAxis默认 x 轴配置AxisProps-见下
yAxis默认 y 轴配置AxisProps-见下
chartRender自定义渲染方式,此方法开启默认渲染方式不渲染,chart setSeries 当前图例参数配置,setAxis 轴线配置,dataSource 传入数据Function(chart,{setSeries:(series,list:dataSourceindex,index:index,chart3D)=>void,setAxis:(axis,AxisProps)=>void},dataSource)=>void

InitProps

参数名说明必填类型默认值备注
width图表宽度Number 或 undefinedundefined-
height图表高度Number 或 undefined400-
theme皮肤ThemesProps--

LegendProps

参数名说明必填类型默认值备注
show显隐Booleanfalse-
title标题Stringlegend-
emptyFilltitle 空置状态Booleanfalse-
titleColortitle 填充色String#000-
position位置 disable 为 false 默认系统配置 true 自定义位置Object#000{dislabe:false,point:{x:0,y:0}}
direction条目排列方向'vertical' 或 'horizontal'vertical-
entries使用回调函数设置 LegendBoxEntries 的样式(entry, component) => entry.setTextFillStyle(new SolidFill({ color: ColorRGBA(255, 0, 0) }))() => undefined-

AxisProps

参数名说明必填类型默认值备注
title轴名称String--
titleColor名称颜色String-rgba(255,255,255,1) 或 #fff
dragging拖拽 仅 2D 生效Boolean-true
draggingZoom拖拽放大 仅 2D 生效Boolean-true
WheelingZoom滚轮放大 仅 2D 生效Boolean-true
WheelingZoom滚轮放大 仅 2D 生效Boolean-true
strokeStyle样式Object-{thickness:Number,color:String}
fontSettings字体设置FontSettingsProps--
scrollStrategy滚动策略fitting 或 expansion 或 progressive 或 regressivefitting-
tickStrategy刻度策略Empty 或 Numeric 或 DateTime 或 TimeNumeric-
tickStrategyStyler刻度策略回调(TickStrategyStyler)=>tickStrategy--
animationScroll动画滚动boolean 或 undefinedundefined-
interval轴刻度间隔Arrayundefined[start: number, end: number, animate: number 或 boolean 或 undefined, disableScrolling: boolean 或 undefined]

ChartConfigProps

参数名说明必填类型默认值备注
title图表标题String--
titleColortitle 填充色String--
emptyFilltitle 空置状态Booleanfalse-
boundingBox3D 视图盒子大小Object-{x:Number,y:Number,z:Number} x:高 y:长 z:宽
boundingBoxStroke3D 视图盒子边框Object-{thickness:Number,color:String} thickness:粗细 color:颜色
backgroundColor外背景色String-rgba(255,255,255,1) 或 #fff
border外边框Object-{width:Number,color:String} width:宽度 color:颜色
seriesBackgroundColor内背景色String-rgba(255,255,255,1) 或 #fff
seriesBorder内边框Object-{width:Number,color:String} width:宽度 color:颜色
mouseInteractionPan鼠标平移Booleantrue-
mouseInteractionRectangleFit鼠标矩形适合Booleantrue-
mouseInteractionRectangleZoom鼠标矩形缩放Booleantrue-
mouseInteractionWheelZoom鼠标滚轮缩放Booleantrue-
cursor光标CursorProps-见下

CursorProps

参数名说明必填类型默认值备注
mode模式snapToClosest 或 onHover 或 disabledsnapToClosest-
pointMarker点标记Booleantrue-
resultTable结果表resultTableProps-见下
xx 轴刻度线TickProps-见下
yy 轴结果表TickProps-见下

resultTableProps

参数名说明必填类型默认值备注
align位置LeftTop、LeftCenter、LeftBottom、Center、RightTop、RightCenter、RightBottomLeftTop-
backgroundColor背景色Stringrgba(255,255,255,1) 或 #fff-
fontColor字体颜色Stringrgba(255,255,255,1) 或 #fff见下
autoText结果表Booleanfalse-
(...FontSettings)字体设置FontSettingsProps--

TickProps

参数名说明必填类型默认值备注
thickness粗细Number1-
color颜色snapToClosest 或 onHover 或 disabledsnapToClosest-
gridEmpty网格Booleanfalse-
tickMarker模式TickMarkerProps--

TickMarkerProps

参数名说明必填类型默认值备注
fontColor字体颜色Stringrgba(255,255,255,1) 或 #fff-
backgroundColor背景颜色Stringrgba(255,255,255,1) 或 #fff-
autoText自动填充Booleanfalse-
disabled启用禁用Booleantrue-
(...FontSettings)字体设置FontSettingsProps--