Blog

All Blog Posts  |  Next Post  |  Previous Post

Chart data import in Delphi

Wednesday, June 29, 2022

TMS FNC Chart v2.0 is a major milestone and we are already collecting feedback and thinking about new features for the next version. We listed some of the top requested features in this blog post, but if you have other exciting ideas, please let us know in the comments. The blog post also gives an overview of what v2.0 brings alongside some very interesting chart related topics!

Data Import

This specific blog post however, focuses on a very important aspect of application development: data import. TMS FNC Chart is designed with one thing in mind: flexibility. The main goal in the FNC architecture has always been flexibility, and in TMS FNC Chart, this is no different. TMS FNC Chart is capable of importing JSON, CSV & custom data arrays. While designing these specific features, we aimed for loading data with a single line of code, but with the ability to customize the details. After running through installation process, you'll find a demo which focuses on data import and demonstrates how to bring out the maximum potential of the chart. As a small code snippet, you'll see how easy it is to add & append data.

procedure TForm1.LoadInitialData;
var
  loadOptions: TTMSFNCChartLoadOptions;
begin
  loadOptions := TTMSFNCChartLoadOptions.Create;
  try
    loadOptions.YRange := arEnabledZeroBased;
    TMSFNCBarChart1.LoadFromDataArray(loadOptions, 0, [123, 98, 54, 154, 128, 87, 103], nil, ['Apple', 'Watermelon', 'Pineapple', 'Pear', 'Banana', 'Lemon','Grapefruit', 'Peach']).LegendText := 'Sold';
  finally
    loadOptions.Free;
  end;
end;
The above code snippet loads the initial data.

procedure TForm1.AppendData;
var
  s: TTMSFNCChartSerie;
begin
  s := TMSFNCBarChart1.AddSeriesFromDataArray([0.88, 1.32, 2.43, 0.76, 0.44, 1.03, 1.10]);
  s.YValues.Positions := [ypLeft];
  s.LegendText := 'Price';
end;

Afterwards, we can append data and add new series without having to clear the ones that already exist.

TMS Software Delphi  Components

Code snippets are great to get started, but what's even better is a video, explaining the capabilities in detail.

Feedback

In the coming weeks, we'll bring out more videos, so stay tuned! Anything you wish to see covered in a video or blog post? Please let us know.



Pieter Scheldeman




This blog post has received 6 comments.


1. Wednesday, June 29, 2022 at 3:27:52 PM

Hi,
Is it possible yo have horizontal barchart ?
Thanks for your work !


REYNS GREGOIRE


2. Wednesday, June 29, 2022 at 3:38:51 PM

No, unfortunately there is no horizontal mode implemented, but a very good suggestion!

Pieter Scheldeman


3. Wednesday, June 29, 2022 at 4:14:22 PM

Does it possible that it can be the tableview which can show text + progress for a downloader?

stlcours


4. Thursday, June 30, 2022 at 10:46:51 AM

Please ask your questions which are not related to this blog post via our support channels

Pieter Scheldeman


5. Thursday, June 30, 2022 at 5:11:26 PM

If you look at River Charts, they have a functionality called "Chart in a Chart".
I do find it useful when there is need to do a fine grain drill down

Nalin


6. Tuesday, July 5, 2022 at 3:23:19 PM

Thank you for your feedback!

Pieter Scheldeman




Add a new comment

You will receive a confirmation mail with a link to validate your comment, please use a valid email address.
All fields are required.



All Blog Posts  |  Next Post  |  Previous Post