Hi Steema software support team,
I'm working on creating a time-frequency analysis map using TColorGrid, and I'm trying to implement scrolling functionality. Specifically, I want the map to continuously move with time.
Here's what I need to achieve:
New data values should be added to the bottom of the map as time progresses.
Old data values need to be removed from the top of the map to make room for the new data.
The map consists of approximately 200 rows, corresponding to a total time span of 200 milliseconds.
I'm looking for guidance on how to implement this scrolling behavior using TColorGrid in my project. Any help or pointers would be greatly appreciated!
Thanks in advance for your assistance
Sciensoria
How to get TColorGrid scrolling
Re: How to get TColorGrid scrolling
Hello Sciensoria,
If you add a ColorGrid to a Chart and add the following code you'll see a basic scroll on the data:
You could add a timer to run those scrolls and automate it.
For the removal of points, it depends on the kind of data. Being a 3D dataset the number of points is proportional to x * y
values. ie. For this very simple dataset, with Integer indexed values of 0 to 19 (20 values) on the X and Y axes something like the following would work:
That shows the basic principle, you'll need to make adjustments according to how your data is laid out. You will apply this vertically in place of the horizontal of this example.
Regards,
Marc Meumann
If you add a ColorGrid to a Chart and add the following code you'll see a basic scroll on the data:
Code: Select all
procedure TForm5.Button1Click(Sender: TObject);
begin
Chart1.Axes.Bottom.Scroll(1); //scroll right
end;
procedure TForm5.Button2Click(Sender: TObject);
begin
Chart1.Axes.Bottom.Scroll(-1); //scroll left
end;
procedure TForm5.FormCreate(Sender: TObject);
begin
Series1.FillSampleValues(20);
Chart1.Axes.Bottom.SetMinMax(5,15);
end;
For the removal of points, it depends on the kind of data. Being a 3D dataset the number of points is proportional to x * y
values. ie. For this very simple dataset, with Integer indexed values of 0 to 19 (20 values) on the X and Y axes something like the following would work:
Code: Select all
procedure TForm5.Button1Click(Sender: TObject);
begin
Chart1.Axes.Bottom.Scroll(1);
//add new data ....and:
DeleteFirstColumn;
end;
procedure TForm5.DeleteFirstColumn;
var i, NumberOfColumns : Integer;
begin
NumberOfColumns := Round(Series1.XValues.MaxValue - Series1.XValues.MinValue) + 1;
for i := 19 downto 0 do
Series1.Delete(i*NumberOfColumns);
end;
Regards,
Marc Meumann
Steema Support
-
- Newbie
- Posts: 7
- Joined: Wed Nov 30, 2016 12:00 am
Re: How to get TColorGrid scrolling
Dear Steema Support Team,
Thank you, Marc, very much for your explanation about how to make a colorgrid scrolling.
Currently, I am interested in customizing the color range to create a visually appealing color map. I've noticed that there are several properties available, such as StartColor, MidColor, EndColor, and StartZ, among others.
Could you kindly provide me with a complete example that demonstrates how to effectively use these properties in combination to achieve the desired color map customization? Your guidance and expertise in this matter would be greatly appreciated.
Thank you for your assistance.
Sincerely,
Sciensoria
Thank you, Marc, very much for your explanation about how to make a colorgrid scrolling.
Currently, I am interested in customizing the color range to create a visually appealing color map. I've noticed that there are several properties available, such as StartColor, MidColor, EndColor, and StartZ, among others.
Could you kindly provide me with a complete example that demonstrates how to effectively use these properties in combination to achieve the desired color map customization? Your guidance and expertise in this matter would be greatly appreciated.
Thank you for your assistance.
Sincerely,
Sciensoria
Re: How to get TColorGrid scrolling
Hello,
I'd suggest you to take a look at the ColorGrid example in the Features Demo shipped with the binary installer.
Here some screenshots changing some of the properties you mention:
viewtopic.php?f=3&t=16044&p=71207#p71207
I'd suggest you to take a look at the ColorGrid example in the Features Demo shipped with the binary installer.
Here some screenshots changing some of the properties you mention:
viewtopic.php?f=3&t=16044&p=71207#p71207
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 7
- Joined: Wed Nov 30, 2016 12:00 am
Re: How to get TColorGrid scrolling
Dear Yeray,
I am trying to customize a ColorGrid series in order to display appropriate colors corresponding to my input values. I have checked the link you provided
However, in my case, I cannot modifiy the values on the right hand: they are all 0.537 and I don't know how to change them.
In addition, I would like to know how to do this by code, especially in the run time.
Thank you for your support.
Sciensoria
I am trying to customize a ColorGrid series in order to display appropriate colors corresponding to my input values. I have checked the link you provided
Among the pictures you provided in the link above, I see in the tab "Grid3D -> Palette -> Colors, you set Style=Custom, Custom Palettes = Rainbow and you have underneath 3 columns: index, Colors, UptoValue. You have different values -0.82, -0.754, -0.688, etc. corresponding to different colors on the left hand.Yeray wrote: ↑Thu Jan 25, 2024 7:52 amHello,
I'd suggest you to take a look at the ColorGrid example in the Features Demo shipped with the binary installer.
Here some screenshots changing some of the properties you mention:
viewtopic.php?f=3&t=16044&p=71207#p71207
However, in my case, I cannot modifiy the values on the right hand: they are all 0.537 and I don't know how to change them.
In addition, I would like to know how to do this by code, especially in the run time.
Thank you for your support.
Sciensoria
Re: How to get TColorGrid scrolling
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |