[SOLVED] dateTime values into datapoints editor lazarus / 55-TAChart ---------------------------------------------------------------------- wittbo · 2018-01-03 15:18 I'm just experimenting with the TAChart components. I need a DateTime value based X-Axis, for quick checking I would like to use the datapoints editor of the ListChartSource component. Is it possible to enter datetime values directly into the X column of the editor (actually I don't have success, for example I entered '01/01/2018', but the result was 0) or does is only accept numeric values? Thanks for help. ---------------------------------------------------------------------- wp · 2018-01-03 17:44 The datapoints editor only accepts numbers in the X and Y columns. Of course, TDate, TTime and TDateTime are numbers internally. The number value of Jan 1 2018 for example is 43101. So, if you want to construct X date values in 1-day intervals starting at Jan 1, you enter the numbers 43101, 43102, 43103, etc. in the X column. In r56940 I modified the ListChartSource to accept also date/time values in the X and Y columns. You must change to  Lazarus trunk to get this feature. Or you must patch your local Lazarus version yourself with these two changes: Open unit tachartutils.pas (from (lazarus)/components/tachart) and add a function which, of course, must be declared also in the interface part of the unit:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i function StrToFloatOrDateTimeDef(const AStr: String): Double;begin  if    not TryStrToFloat(AStr, Result, DefSeparatorSettings) and    not TryStrToFloat(AStr, Result) and    not TryStrToDateTime(AStr, Result)  then    Result := 0.0;end;Then open unit tasources.pas and find procedure TListChartSourceStrings.Parse. Replace each one of the three calls to StrToFloatDefSep by this new function, StrToFloatOrDateTimeDef.Nevertheless, using the datapoints editor is not really recommended. Better to write a few lines of code to add the data points. ---------------------------------------------------------------------- wittbo · 2018-01-04 12:09 Thanks a lot for your answer. It was a good help. Of course it will be better to write code in practice. But the datapoints editor is quite good for experimenting during design time with the effects of the hundreds ( ) of TChart Parameters, which are rather complex for TAChart newbies like me. ---------------------------------------------------------------------- wp · 2018-01-04 13:36 Of course. But usually, your precise data are not needed at all just to play with parameters and to see what they change. It is much easier to use a TRandomChartsource for the design phase and replace it later by the chart source with the real data. I once described this strategy in a tutorial, http://wiki.lazarus.freepascal.org/TAChart_Tutorial:_St acked_BarSeries#Designing_the_chart_with_random_data is section on the design phase.