轻量级图表版本:3.1.3
我正在使用您的图表作为Vue项目中的加密货币交易应用程序,但是无论我得到什么,下面的错误都是一个示例代码。
没有重复或空数据.
import {createChart} from "lightweight-charts";
export default {
data() {
return {
chartProperties: {
width: 700,
height: 300,
timeScale: {
timeVisible: true,
secondsVisible: false
},
layout: {
//backgroundColor: '#262C49', //Dark Theme
//textColor: '#80859E',
fontSize: 12,
fontFamily: 'irsans ,Calibri'
}
},
chartData: [],
candleSeries: null,
}
}
mounted() {
let cdata = [
{
close: 22750.76
high: 22759.53
low: 22750.25
open: 22752.8
time: 1608635340
},
....
];
this.chartElement = document.getElementById('chart');
this.chartProperties.width = this.chartElement.offsetWidth;
this.chart = createChart(this.chartElement, this.chartProperties);
this.candleSeries = this.chart.addCandlestickSeries();
this.candleSeries.setData(cdata);实际行为:
图表是用没有烛台画的。

和未明错误的重复错误:值为空

发布于 2020-12-22 13:31:06
如果您得到这个错误,99%有可能您的数据源有三个问题之一
发布于 2021-04-20 05:03:21
如果您使用的是对象结构,那么在向数组中添加一个新元素之后,难道没有忘记逗号吗?
let cdata = [{关口: 22750.76,高: 22759.53,低: 22750.25,开: 22752.8,时间: 1608635340,},]
因为如果没有逗号,它似乎是对象中唯一的元素,这是不正确的。
https://stackoverflow.com/questions/65408588
复制相似问题