Does anyone know a good tutorial for TAChart with database? lazarus / 55-TAChart ---------------------------------------------------------------------- szocsmarci · 2013-02-13 22:24 Hi I did through the tutorials, but I couldn't find a tutorial to database connection. I can not  figure out by myself. I have  read this http://wiki.lazarus.freepascal.org/TAChart , but it doesn't contain what I'm looking for. I have a query, what comes back with a table date's (as X) and data's (as Y).  I could fill the source one by one with a for .. to cycle, but it would use the memory twice, and i think it would be a slower solution. ---------------------------------------------------------------------- joseme · 2013-02-14 01:21 There is a good tutorial in http://wiki.lazarus.freepascal.org/TAChart _Tutorial:_Userdefined_ChartSource , by using a TUserDefinedChartSource you can avoid the extra use of memory. ---------------------------------------------------------------------- Ask · 2013-02-14 03:07 Quote have a query, what comes back with a table date's (as X) and data's (as Y).You can use TDbChartSource for that. See "db" demo for an example. Note that currently TDbChartSource has some issues which may affect your usage. ---------------------------------------------------------------------- szocsmarci · 2013-02-18 21:52 Thanks, I had read this article, but I found too hard. And I didn't understand this: Database source Property    Access method FieldX :   AsFloat FieldY :   AsFloat FieldColor :    AsInteger FieldText :   AsString The FieldX must be a string, the name of the column. In my case the date, and a DateTimeIntervalChartSource must be set set up, and the Bottom axis Marks. Style = "smsLegend" is neccessary to print the timeat the X axis. The FieldY is the name of the value's column. None of them are floats, they are string, containing the name of the table's column. I don't know what is FieldText for, but it seems, that works without it. Joseme: The Userdefined ChartSource is not perfect for this case. The values must be copied from the database, therefore it is doubled in memory, and if data changes, must be updated manually.