I haven't thoroughly examined your code (a little complex),
but maybe this brute force approach will help.
Instead of posting your results directly into the chart object,
just post them in a vacant column. If you expect 500 data points,
just have your code put them in 500 rows. Then, manually select
the range and create the chart. If nothing else, you may uncover
a logic error during your attempt to populate the column with the
500 data points.