Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/461.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/google-apps-script/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 在Lightning图表中为PointSeries添加边框并动态更改颜色_Javascript_Lightningchart - Fatal编程技术网

Javascript 在Lightning图表中为PointSeries添加边框并动态更改颜色

Javascript 在Lightning图表中为PointSeries添加边框并动态更改颜色,javascript,lightningchart,Javascript,Lightningchart,我使用下面的代码 const pointz = chart.addPointSeries({ pointShape: PointShape.Circle }) .setName('Kuopio') .setPointFillStyle(fillStyles[0]) .setPointSize(pointSize) .setMaxPointCount(10000); 创建如下所示的点图 有没有办法给这个圆圈添加边框颜色?以及如何分别改变个人颜色谢谢 我试过了,但

我使用下面的代码

const pointz = chart.addPointSeries({ pointShape: PointShape.Circle })
    .setName('Kuopio')
    .setPointFillStyle(fillStyles[0])
    .setPointSize(pointSize)
    .setMaxPointCount(10000);
创建如下所示的点图

有没有办法给这个圆圈添加边框颜色?以及如何分别改变个人颜色谢谢

我试过了,但是没有改变颜色

 pointz.add({ x: xVal, y: yVal-20, color: ColorRGBA( 255, 255, 255 )})

请像JSFIDLE一样使用它-

LightningChart中的PointSeries JS不支持向点添加边框

要单独更改点颜色,需要使用。 创建新的IndividualPointFill时,需要指定备用颜色。当点没有与之关联的其他颜色信息时,将使用此颜色

const fillStyle=new IndividualPointFill({color:ColorHSV(0)})
const series=chart.addPointSeries()
.setPointFillStyle(fillStyle)
//使用回退颜色添加点
series.add({x:0,y:0})
//添加点并指定颜色
series.add({x:1,y:0,color:ColorHSV(200)})
//从LightningChartJS中提取所需的部分。
常数{
光照图,
固体填料,
实线,
调色板,
空注,
战略,,
点形状,
单点填充,
彩色HSV
}=lcjs
//----缓存使用的样式-----
常量pointSize=10
常量调色板=调色板。全光谱(10)
常量颜色=[0,6]。贴图(调色板)
const fillStyles=colors.map(color=>newindividualpointfill({color}))
//确定日期时间轴的原点。
const dateOrigin=新日期(2018年8月1日)
//创建XY图表。
常量图表=lightningChart().ChartXY({
defaultAxisXTickStrategy:AxisTickStrategies.DateTime(dateOrigin),
})
.设置填充({
右:50
})
//为每个点簇添加一个系列
const fstClusterSeries=chart.addPointSeries({pointShape:pointShape.Circle})
.setPointFillStyle(fillStyles[0])
.setPointSize(点大小)
const sndClusterSeries=chart.addPointSeries({pointShape:pointShape.Triangle})
.setPointFillStyle(fillStyles[1])
.setPointSize(点大小)
//提供给series的点的X值将乘以该值(以便于添加日期时间值)。
常数数据频率=1000*60*60*24
常数kuopioPoints=[
{x:12.152641878669275,y:5335.336538461539},
{x:11.62426614481409,y:5259.615384615385},
{x:10.919765166340508,y:5082.932692307692},
{x:10.15655772994128,y:4923.076923076923},
{x:9.3346379664774949,y:4796.875},
{x:8.101761252446183,y:4704.326923076923},
{x:6.6340508806223,y:4620.192307692308},
{x:3.933463796477495,y:4418.2692307692305},
{x:3.111545988258317,y:4342.548076923077},
{x:2.818003913894347,y:4199.5192307692305},
{x:2.818003913894347,y:4014.423076923077},
{x:2.4657534246575334,y:3930.2884615353844},
{x:2.407045009784736,y:3745.1923076923076},
{x:2.93542074369921,y:3408.653846153846},
{x:3.6399217221135025,y:3307.6923076923076},
{x:5.107632093933463,y:3181.4903846153848},
{x:6.868884540117416,y:3181.49038446153848},
{x:7.749510763209393,y:3198.3173076923076},
{x:9.21722135029353,y:3316.1057692307695},
{x:10.215264876929,y:3475.9615384615386},
{x:11.037181996086105,y:3585.3365384615386},
{x:12.035225048923678,y:3719.951923076923},
{x:12.798434442270057,y:3778.846153846154},
{x:16.027397260273972,y:3820.9134615384614},
{x:22.544031311154598,y:3896.6346153846152},
{x:24.187866927592953,y:3963.9423076923076}
]
恒赫尔辛基机场=[
{x:6.164383561643835,y:2314.6634615384614},
{x:6.5166340505880624,y:2351.2019230769233},
{x:7.045009784735812,y:2479.0865384615386},
{x:7.27984344227005,y:2543.028846153846},
{x:7.514677103718199,y:2638.9423076923076},
{x:8.277886497064578,y:2794.230769230769},
{x:8.63013698630137,y:2853.605769230769},
{x:10.15655772994128,y:2972.355769230769},
{x:10.919765166340508,y:3018.028846153846},
{x:11.800391389432484,y:3063.7019230769233},
{x:12.798434442270057,y:3109.375},
{x:14.442270058708415,y:3155.0480769230767},
{x:16.3209334637963,y:2538.4615384615386},
{x:17.729941291585128,y:2511.0576923076924},
{x:14.442270058708415,y:2465.3846153846152},
{x:12.093933463796477,y:2529.326923076923},
{x:12.857142857142856,y:2597.8365384615386},
{x:12.563600782778865,y:2419.7115384615386},
{x:12.798434442270057,y:2342.0673076923076},
{x:13.79647749510763,y:2296.394230769231},
{x:13.033268101761252,y:2282.6923076923076},
]
//很好地设置视图。
chart.getDefaultAxisX()
.setInterval(0*dataFrequency,30*dataFrequency,true,true)
chart.getDefaultAxisY()
.setInterval(15006500,真,真)
/**
*将点簇添加到指定的序列并为其创建帧
*@param{PointSeries}系列,该系列应包含群集
*@返回函数,接收一组点
*/
const drawCluster=(系列、点、颜色偏移)=>{
//将点添加到指定系列
series.add(points.map)(point=>({
x:point.x*数据频率,
y:点,y,
颜色:Math.random()>0.5?ColorHSV(colorOffset+(50*Math.random()):未定义
})))
}
绞车组(fstClusterSeries,kuopioPoints,100)
drawCluster(sndClusterSeries,赫尔辛基机场,0)

您好,这是如何有边框的?该示例使用椭圆序列来显示圆圈。显示椭圆的方法更加手工和灵活。它可以像点序列一样使用,期望在图表缩放时不会缩放椭圆,除非序列附加到使用ui比例作为比例的轴。椭圆系列确实支持笔划样式,因此具有边框。它要求将样式分别设置为每个椭圆。如果你真的