lightningchart - 为散点图设置单个大小的大小
问题描述
我们可以更改单个分散系列项目的大小吗?现在这可以改变颜色
点系列
.add([
{ x: 2.5, y: 0, color: ColorRGBA( 255, 0, 0 ) },
{ x: 5, y: 10 },
{ x: 7.5, y: 20, color: ColorRGBA( 0, 255, 0 ) },
{ x: 10, y: 30, color: ColorRGBA( 0, 0, 255 ) },
])
就像是
{ x: 2.5, y: 0, color: ColorRGBA( 255, 0, 0 ) , size : 2 },
解决方案
可以指定PointSeries的单个点的大小。
添加新点时,您需要启用单个点大小调整series.setIndividualPointSizeEnabled(true)
以启用字段的使用。size
然后,您可以在将点添加到系列时包含尺寸信息。 series.add({ x: 2.5, y: 0, size: 30 })
series.setPointSize
可用于定义未定义单独大小的点的大小。
const {
lightningChart,
IndividualPointFill,
ColorRGBA
} = lcjs
const lc = lightningChart()
const chart = lc.ChartXY()
const series = chart.addPointSeries()
series.setIndividualPointSizeEnabled(true)
series.setPointFillStyle(new IndividualPointFill())
series.setPointSize(10)
series.add([
{ x: 2.5, y: 0, color: ColorRGBA(255, 0, 0), size: 30 },
{ x: 5, y: 10 },
{ x: 7.5, y: 20, color: ColorRGBA(0, 255, 0), size: 5 },
{ x: 10, y: 30, color: ColorRGBA(0, 0, 255), size: 20 },
])
<script src="https://unpkg.com/@arction/lcjs@2.2.1/dist/lcjs.iife.js"></script>
推荐阅读
- excel - 从 Excel 管理对 Azure Data Lake 中文件夹的授权
- asp.net - 没有参数的 Http 路由和路由内的一个点
- c# - 使用 RefactorThis.GraphDiff 库
- google-app-engine - 使用 Web API 在 Google App Engine 中创建应用程序失败。错误:409 - 此应用程序已存在且无法重新创建
- python - 在 python 2.7 中使用 comtypes 获取正在运行的 AutoCAD 应用程序
- javascript - 在被 raw-loader 引入之前如何编译一个 javascript 文件?
- jquery - Flexslider 缩略图轮播活动类无法正常工作
- c++ - 如何对成对的向量进行排序
不管字符串 - javascript - 图像中间的画布文本
- git - 从git拉取离子源代码后,无法在本地运行代码