在分钟和秒上使用 AmCharts 设置 StockEvents
Setting StockEvents with AmCharts on Minutes and Seconds
我在 AmCharts 的各种不同项目中取得了很多成功。这相当容易,但我已经相对轻松地将 stockEvents 添加到图表中。但是,那是以日期为唯一值的。现在我正在使用分钟和秒,但我似乎无法正确插入 stockEvent。这是我正在尝试做的一个 jsfiddle:https://jsfiddle.net/punksgt/vshkv4xq/
相信问题出在 stockEvents
的某个地方:
"stockEvents": [{
"date": new Date(2012, 0, 1, 0, 0, 3, 592),
"type": "sign",
"backgroundColor": "#85CDE6",
"graph": "g1",
"text": "S",
"description": "This is description of an event"
}],
我最终正在寻找类似这样的东西来调用图表上的事件。 https://www.amcharts.com/demos/stock-events/
stockEvents
需要在关联的dataSet
中设置。您的 fiddle 将其设置在其外部。
"dataSets": [{
"color": "#b0de09",
"fieldMappings": [{
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
}],
"dataProvider": chartData,
"categoryField": "date",
"stockEvents": [{
"date": new Date(2012, 0, 1, 0, 0, 3, 592),
"type": "sign",
"backgroundColor": "#85CDE6",
"graph": "g1",
"text": "S",
"description": "This is description of an event"
}],
}],
该事件还需要在您数据的日期范围内(您的 fiddle 将日期设置为 2012-01-01 之前 1000 天,因此它不会显示)。
我在 AmCharts 的各种不同项目中取得了很多成功。这相当容易,但我已经相对轻松地将 stockEvents 添加到图表中。但是,那是以日期为唯一值的。现在我正在使用分钟和秒,但我似乎无法正确插入 stockEvent。这是我正在尝试做的一个 jsfiddle:https://jsfiddle.net/punksgt/vshkv4xq/
相信问题出在 stockEvents
的某个地方:
"stockEvents": [{
"date": new Date(2012, 0, 1, 0, 0, 3, 592),
"type": "sign",
"backgroundColor": "#85CDE6",
"graph": "g1",
"text": "S",
"description": "This is description of an event"
}],
我最终正在寻找类似这样的东西来调用图表上的事件。 https://www.amcharts.com/demos/stock-events/
stockEvents
需要在关联的dataSet
中设置。您的 fiddle 将其设置在其外部。
"dataSets": [{
"color": "#b0de09",
"fieldMappings": [{
"fromField": "value",
"toField": "value"
}, {
"fromField": "volume",
"toField": "volume"
}],
"dataProvider": chartData,
"categoryField": "date",
"stockEvents": [{
"date": new Date(2012, 0, 1, 0, 0, 3, 592),
"type": "sign",
"backgroundColor": "#85CDE6",
"graph": "g1",
"text": "S",
"description": "This is description of an event"
}],
}],
该事件还需要在您数据的日期范围内(您的 fiddle 将日期设置为 2012-01-01 之前 1000 天,因此它不会显示)。