My project is simple, to have a stacked 5 min and 15 min charts (with dataGrouping disabled), and need to put some markers (or flags) on some specific points. I've also modified the sample code to have both the crosshair and selected ranges synced. (see (2) and (3)), for whatever reason the sample code from https://jsfiddle.net/BlackLabel/rLy1uxd0/
doesn't work since the Y Axis for both charts are of the same length where I am trying to sync a 5min chart with a 15min chart so coded a little index lookup code as
Code: Select all
// return the chart2 (15m corresponding data array index)
function syncid(v) {
var z;
var c2data = chart2.series[0].processedXData
z = c2data.findIndex(ele => ele >= v);
if (c2data[z] != v) {
z = z -1;
}
return z
}
1. The indicator value subgraph (marked (1)), values are in the range of [-130 to 130], why the system will always pad the area to [-200 to 200]? Is there any way to set it to [-130..130]?
2. I need to read in an array and plot/render/annotate them. The flags/marker is just a simple triangle, no text, and no fancy pictures.
I've read thru the doc and demo codes, seems there're three ways to do this:
1. flags --> being a series, I did a quick check and it has some performance hits!
2. annotate: seems not very convenient to have a loop to quickly build up the annotation data.
3. renderer, I've seen some renderer code and it's not very 'declarative'!
I suspect renderer is the fastest, flags slowest, but renderer is hard to code..
Can annotation handle say > 2000 'triangles' efficiently?
Also do we have some examples of declaring annotations (from a read-in JSON array or set)? All the examples I've seen are individually declared, with an emphasis on showing rich varieties of annotation content (which I don't need!)
Thanks.