I'm using a script to generate a graph, and add callouts to that graph...
Is there a way to anchor each callout to its respective cell within the worksheet range instead of the callout being associated with a point index fixed to the graph?
For example, the image below shows the graph with the desired callouts for a 128k point dataset; there are 131 callouts.
Each callout is labeled as [dataset index, value at that index].
all callouts.PNG
If I change the charts data range from 1-128,000 points to the first 2000 points (range A1:A2000) I get an accurate result (see below).
first2000points.PNG
But, if I change the graph to the second set of 2000 points (range A2000:A4000) then I get datalabels associated with the points/positions within the graphs data range, and not associated with the dataset index (see below).
In other words, changing the graph's data range doesn't move the callout index (1st value in the callout) accordingly.
wrongdata.PNG
So, what I'm asking, is it possible to associate a datalabel with a cell in a range (the original full data range) instead of it being associated with a .SeriesCollection position/index that changes when the graph data range changes?
Thanks in advance,
Bookmarks