It would be helpful to have properties DateTimeX and DateTimeY next to FieldX and FieldY such that TDbChartSource.GetItem would be able to call <field>.AsDateTime instead of, or in addition to, <field>.AsFloat
To be honest, I do not like this solution much.
It would be much better if the database would report the field types accurately,
and then I would be able to just check "F.DataType in [ftDate, ftTime, ftDateTime]"
Unfortunately, my quick test confirmed that at least SQLite is apparently incapable of that.
So I implemented your suggestion in r38025.
If you wish, you can explore whether SQLite dataset can be modified to better
determine field type. I can replace the option by an automatic check as soon
as that becomes viable.
The series draws NULL values as zeros. I think that's not always desired; in most of the cases I'd prefer to have breaks in the curve, i.e. NaN.
Yes, definitely. Fixed in r38023, will nominate for backport.
In my current project TAChart crashes when the DbChartSource contains NULL values.
I doubt the fix you proposed will change that (or, if it does, then
the bug is in either TDataset or SQLite driver).
For now, I have replaced only x/y field accesses with checks,
so less important ones are still done directly.
If you encounter another crash, please try to catch at least the exception message,
and preferably stack trace.
event handler like OnGetChartDataItem(ADataset:TDataset; var Item:TChartDataItem) which could be used to do special conversions
Implemented in r38037.
However, the usage is somewhat tricky -- see the comment in TDbChartSource.GetItem.
Suggestions for better API are welcome -- I have considered various approaches,
such as adding OnBefore/OnAfter/OnInstead(?) events and adding another option
similar to grid's DefaultDrawing, but they all seem too heavy and even more confusing.
If you have no better idea, I'll just write it up on the wiki and optimistically assume that users will read documentation

call DisableControls/EnableControls of the dataset.
This is the most complex issue. First, I did try to call DisableControls/EnableControls some time ago -- turns out they do not work in FPC 2.6 (
http://bugs.freepascal.org/view.php?id=19887). As you can see, there is a workaround, but it is not perfect.
Second, the scrolling is caused be every access to the dataset, not only during the drawing. So to eliminate it, you have to:
1) Add "BeforeDraw" and "AfterDraw" calls to TBasicPointSeries.GetNearestPoint to avoid scrolling while searching for a data point near the mouse
2) Set UseDefaultHintText = false to avoid scrolling while retrieving data for the the default hint text
3) Call DisableControls/EnableControls from OnGetHintText handler
... and even then some flicker will remain due to the bug mentioned above.
As you can see, this is complicated, and, for the moment, I do not know of a good general solution. Suggestions are welcome.
Would it be possible to reposition the hint window above the mouse position? Now it is partly covered by the mouse pointer.
I have added OnHintPosition event in r38028, which should suffice for a simple case.
(Just put APoint.Y -= 20 in the handler).
More generally, the user should be given some declarative control over the hint position -- perhaps TChartMarks property similar to point labels.
Again, suggestions welcome.
If the HintTool does not use an OnHint event handler a huge, empty hint window is displayed.
Indeed. This is technically an LCL bug, I reported it as
bugs.freepascal.org/view.php?id=22498.
Nevertheless, it is a good practice to check for empty hint even if just to
avoid useless system calls, so fixed in r38024.
TDbChartDataSource.GetItem calls TDataset.FieldByName quite often
True, but I suspect the effect is negligible compared to the other sources of inefficiency. In particular, unless the StackOverflow poster had a table with thousands of columns, I am quite convinced that his problems were caused by redrawing of controls, not calling FieldByName.
So I'll postpone this optimization until after the redrawing issue if resolved.