Thanks for the fixes.
Now that the series marks are working with NaN's I am posting an updated version of the ContourFinder and the demo which allows to position the values of the contour levels along the contour lines. This is done by the parameter AMarksPosition passed to the main method, TraceContourAtLevel. I did not put too much effort into avoiding overlapping of marks, but the "random" setting is fine in many cases.
I also was thinking of rotating the marks along the direction of the contour curve. But unfortunately all marks must have the same orientation so far.
Ideally, color map, contouring and your recent interpolation unit should work well together
Yes, they can be combined - see the new demo. A few things to mention: The ZPosition of the ColorMapSeries must be "below" that of the contour series to avoid overpainting the contours by the colormap. And the Sender parameter of the OnNeedXXXX events should be TObject for both contour finder and interpolation -- this allows to use these events for both components.
As you can see in the attached screen shot there are some minor deviations between contour and color map here and there, but this is due to the different interpolation procedures used in both cases. The contour finder always performs a simple linear interpolation between "above" and "below" points to find the intersection with the plane at the contour level. The interpolation unit on the other hand considers also the neighboring points. It would be an idea to apply these more complex interpolations also in the contour finder, but this would require a major design of the algorithm because the connectivity of the neighboring points needs to be known in advance before performing the interpolation. I don't know if this is worth the effort.
I suggest giving some thought to the modularity of contouring algorithms
To be honest I am happy that I got this one working. What might be interesting is to put more emphasis on the similarity of the ContourFinder and the Interpolation because of the same data handling. Maybe I should extract a "TChartDataManager" class which interfaces to any data by means of events.
zooming requires contour re-calculation
No. Having experimental data in mind the contours are calculated only once. Zooming is done by the standard TAChart technology. Of course, the segments of the line series will soon become visible, this is the reason why I had the idea with the spline series.
If you think of theroretical data, it might be an idea to redo the grid layout and the contour calculation when zoom extent changes; but I think this can be done within the standard TAChart events.
added Pointer.OverrideColor property
If it can be achieved simply it would be fine to have that property also for the font of the Marks texts. Then the contour labels could be drawn with the same color as the contour lines which would be more catchy.
Use Legend.Order property
I was thinking of something like TChart's "Inverted" which draws all legend items in the order last to first. But, of course, this is not very essential since the effect can be achieved easily.