Ploting Stock data with multiple days lazarus / 55-TAChart ---------------------------------------------------------------------- chucky · 2013-04-22 06:41 I can produce a nice looking line series chart showing minute interval stock price data but if a try to chart two days I get a large gap with a long straight line between the days from 16:00 (market close) and 9:30 (market open) for the next day. How can I eliminate this gap? Here is how I set the chart:   Chart := LzChart.Create(Self,Self,'MyChart',100,50,300,700);    LS := TLineSeries.Create(Chart);   DT := TDateTimeIntervalChartSource.Create(Chart);    Chart.BottomAxis.Marks.Source := DT;   Chart.BottomAxis.Marks.Style := smsLabel; Then a for next loop to add the points for each day:   LS.AddXY(MyDate,Close_Value); Only data between 9:30 - 16:00 are added. ---------------------------------------------------------------------- wp · 2013-04-22 07:19 After each day add a NaN to the series (Series.AddNull; http://wiki.la zarus.freepascal.org/TAChart_documentation#Skipping_source_items) ---------------------------------------------------------------------- chucky · 2013-04-24 01:30 I added a NaN data item between the days. It got rid of the straight line but the large gap is still there. The x axis needs to jump to 9:30 directly after the previous 16:00 and ignore all the data points in between. ---------------------------------------------------------------------- wp · 2013-04-24 07:18 OK, I see what you mean. I hope your data are equiditant within each day, otherwise it's more complicated. In the equidistant case, simply plot against the data index: Don't use AddXY to add the data to the series, use Add instead -- this uses the index of the data point as x value; and add the date as data label (i.e. Series.Add(value, FormatDateTime('hh:mm', datevalue)). In order to show the axis labels you have to assign the ChartSource used for the series to the BottomAxis of the chart (i.e: Chart.BottomAxis.Marks.Source := Series.ListSource) and set the Style of the BottomAxis marks to smsLabel. As before, use AddNull to create the break. Probably (I did not test what I am writing here) the gap will be 1 datapoint too wide because the AddNull increases the point index. To avoid this, use a separate variable for the data index and add the data by calling AddXY again, but now using the dataindex explicity as the x value, i.e. Series.AddXY(dataindex, value, FormatDateTime(...)). Increment dataindex after each adding a data value, but don't increment it after adding the null.