Blog Options
Archive
<< September 2025 >>-
Wednesday 17
- TMS at the 30 Years of Delphi Celebration in Sinsheim -
Thursday 11
- RAD Studio 13 Florence support for TMS components -
Wednesday 10
- Building a Scalable Gift Aid SaaS Platform with TMS Sphinx, Aurelius, XData, and WEB Core -
Tuesday 9
- Adding an existing library to Smart Setup in 20 minutes -
Friday 5
- A new chapter for TMS -
Thursday 4
- EKON29 The Developer Conference for Delphi -
Wednesday 3
- AI-powered HTML Reports with Embedded Browser Visualization -
Monday 1
- Kickstart the New Academic Year with TMS Academic for Delphi and C++ Developers
- Filter and Sort your tasks in TMS FNC Gantt Chart
- StellarDS: Introduction to Cloud Backend - Technology and Costs
Authors
- Bernard Roussely (2)
- Wagner Landgraf (93)
- Roman Yankovsky (2)
- Bart Holvoet (41)
- Aaron Decramer (55)
- Pieter Scheldeman (124)
- Nancy Lescouhier (32)
- Adrian Gallero (34)
- Bruno Fierens (443)
- Marcos Douglas B. Santos (5)
- Bernard (4)
- Bradley Velghe (33)
- Andrew Simard (86)
- Holger Flick (15)
- Gjalt Vanhouwaert (42)
- Tunde Keller (30)
- Masiha Zemarai (117)
Blog
All Blog Posts | Next Post | Previous Post
TMS FMX Chart update with new virtual mode available
Thursday, October 22, 2015
Where in earlier versions, the method for adding values to a chart was via multiple calls to TMSFMXChart.Series[x].AddSinglePoint(), the new virtual mode offers a faster solution that is more flexible and typically consumes less memory. This can of course make a welcome difference when creating applications for mobile devices.To start using the new TMS FMX Chart virtual mode, two events need to be implemented:
TMSFMXChart.OnGetNumberOfPoints()
and
TMSFMXChart.OnGetPoint()
In the first event, OnGetNumberOfPoints(), that is triggered for each series in the chart, the number of desired data points can be returned via the ANumberOfPoints parameter.
In this sample event handler, the number of points is set to 10000 for each series in the chart:
procedure TForm1.TMSFMXChart1GetNumberOfPoints(Sender: TObject; ASerie: TTMSFMXChartSerie; var ANumberOfPoints: Integer); begin ANumberOfPoints := 10000; end;
var data_arr_1, data_arr_2: array of double; begin SetLength(data_arr_1,10000); SetLength(data_arr_2,10000); for i := 0 to Length(data_arr) - 1 do begin data_arr_1[i] := random(100) / 33; data_arr_2[i] := random(200) / 25; end; end;
procedure TForm1.TMSFMXChart1GetPoint(Sender: TObject; ASerie: TTMSFMXChartSerie; AIndex: Integer; var APoint: TTMSFMXChartPointVirtual); begin case ASerie.Index of 0: if AIndex < Length(data_arr_1) then APoint.YValue := data_arr_1[AIndex] 1: if AIndex < Length(data_arr_2) then APoint.YValue := data_arr_2[AIndex] end; end;
TMSFMXChart1.Series[0].AutoYRange := arEnabled; TMSFMXChart1.Series[0].MaxX := 100; TMSFMXChart1.Series[1].AutoYRange := arEnabled; TMSFMXChart1.Series[1].MaxX := 100;
Bruno Fierens

This blog post has received 1 comment.
All Blog Posts | Next Post | Previous Post
Gromov Vsevolod