TeeChart Animation

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)

Re: TeeChart Animation

Postby realsol » Tue Dec 12, 2017 8:50 am

Thanks. Just what I needed to see.
realsol
Newbie
Newbie
 
Posts: 70
Joined: Mon Feb 27, 2017 12:00 am

Re: TeeChart Animation

Postby realsol » Sat Apr 07, 2018 6:27 pm

I have since moved to Tokyo, update 3 and purchased the Pro version. But every time I try to add to change things in the Chart Editor, Delphi seems to crash with the attached error.

After downloading AnimationsChart.zip and automated the Pie Chart using the timer method. I'm a bit surprised that the animation requires it's own timer. But I am having a problem automating the 4 series Bar Chart. Since I can't mess with the editor, what I would like is a bit of example code.

I want to be able to animate all the bars at once after ALL of their queries are executed. Just like the zip file, but with all series if active.

Thanks.
Attachments
2018-04-07_0950.png
2018-04-07_0950.png (7.19 KiB) Viewed 140 times
realsol
Newbie
Newbie
 
Posts: 70
Joined: Mon Feb 27, 2017 12:00 am

Re: TeeChart Animation

Postby Yeray » Mon Apr 09, 2018 11:59 am

Hello,

I've cleaned the project a little bit and added several bar series to it.
AnimationCharts.zip
(2.15 KiB) Downloaded 17 times


See how it moves in this gif:

2018-04-09_14-00-07.gif
2018-04-09_14-00-07.gif (229.48 KiB) Viewed 134 times
Best Regards,

ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image ImagePlease read our Bug Fixing Policy
Yeray
Site Admin
Site Admin
 
Posts: 8369
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Re: TeeChart Animation

Postby realsol » Mon Apr 09, 2018 3:42 pm

Thanks.

1. Can you tell me what controls the spacing between the bars? As you can see from this image, the bars kinda overlap. I would like them to be evenly spaced and not overlapping.
2. After I drill down to a small pie slice, the bar char is hardly noticeable. How do I adjust the chart so the Bar height is recognizable? In other words, how do I lower the grid to match the bar size so when I drill down, it will fill the bar chart.
3. How can I tell which bars are checked?
Attachments
2018-04-09_0838.png
2018-04-09_0838.png (37.81 KiB) Viewed 129 times
2018-04-09_0837.png
2018-04-09_0837.png (73.42 KiB) Viewed 129 times
realsol
Newbie
Newbie
 
Posts: 70
Joined: Mon Feb 27, 2017 12:00 am

Re: TeeChart Animation

Postby realsol » Wed Apr 11, 2018 4:24 am

- Bump -
realsol
Newbie
Newbie
 
Posts: 70
Joined: Mon Feb 27, 2017 12:00 am

Re: TeeChart Animation

Postby Yeray » Wed Apr 11, 2018 8:15 am

Hello,

realsol wrote:1. Can you tell me what controls the spacing between the bars? As you can see from this image, the bars kinda overlap. I would like them to be evenly spaced and not overlapping.

Sounds as a rounding issue. I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=2027

realsol wrote:2. After I drill down to a small pie slice, the bar char is hardly noticeable. How do I adjust the chart so the Bar height is recognizable? In other words, how do I lower the grid to match the bar size so when I drill down, it will fill the bar chart.

How are you doing that drill down? Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.

realsol wrote:3. How can I tell which bars are checked?

You can loop all the series and see which ones are "TBarSeries" and "Active". Ie:
Code: Select all
var i: Integer;
//...
  for i:=0 to Chart1.SeriesCount-1 do
    if (Chart1[i] is TBarSeries) and (Chart1[i].Active) then
      //do whatever


realsol wrote:- Bump -

You may be interested in the Pro Support option.
Best Regards,

ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image ImagePlease read our Bug Fixing Policy
Yeray
Site Admin
Site Admin
 
Posts: 8369
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Re: TeeChart Animation

Postby realsol » Wed Apr 11, 2018 4:11 pm

Sounds like a rounding issue. I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=2027

This was the same as the regular rectangle bars as all my other images in my other posts show. There are so many setting (a tribute to a mature component offering), I know I was the one that caused it. I don't know how.

How are you doing that drill down? Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.


I can demonstrate with two graphics.

1. This first one shows a bar graph representing all income and expense category totals by month.
2. The second chart represents the result after a user clicks on the shopping category slice

I would like to redraw the grid to match the highest bar like on the first chart. For the user, it is hard to tell the shopping totals which such $7000 grid.
Attachments
2018-04-11_0903.png
After user clicks on the 'Shopping' slice
2018-04-11_0903.png (48.76 KiB) Viewed 77 times
2018-04-11_0902.png
All Bars and full pie
2018-04-11_0902.png (32.67 KiB) Viewed 77 times
realsol
Newbie
Newbie
 
Posts: 70
Joined: Mon Feb 27, 2017 12:00 am

Re: TeeChart Animation

Postby Yeray » Thu Apr 12, 2018 6:53 am

Hello,

The exact place and exact values depend on the exact code in your project, but you probably have to call SetMinMax(min, max) on the Left axis to set the axis scale that better fits the data to show.
Best Regards,

ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image ImagePlease read our Bug Fixing Policy
Yeray
Site Admin
Site Admin
 
Posts: 8369
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Re: TeeChart Animation

Postby realsol » Thu Apr 12, 2018 7:35 pm

Thanks. I'll give it a shot. My Bar Chart has 4 series each controlled by a Query.

If I display the chart with animation (with queries that lower the values of the bars), the bars are updated, but the OnGetLegendText never gets called, so the amounts and text remain the same. Here is the code:

Code: Select all
          if DBChart2.Tools.Count = 1 then
          with DBChart2.Tools.Add(TSeriesAnimationTool) as TSeriesAnimationTool do
          begin
            duration := 250;
            Series:=DBChart2[4];
            Play;
          end;


If I comment out the above code, both the bars and legend are updated when the queries are updated. How can I update the legend to the correct values when using animation?
realsol
Newbie
Newbie
 
Posts: 70
Joined: Mon Feb 27, 2017 12:00 am

Re: TeeChart Animation

Postby Yeray » Tue Apr 17, 2018 6:37 am

Hello,

I'm trying to reproduce the problem with this code but it seems to work fine for me here:

Code: Select all
uses Series, TeeAnimations;

var animationTool: TSeriesAnimationTool;

procedure TForm1.FormCreate(Sender: TObject);
begin
  Chart1.View3D:=False;

  with Chart1.AddSeries(TBarSeries) as TBarSeries do
  begin
    ColorEachPoint:=True;
    Marks.Hide;
    FillSampleValues;
  end;

  animationTool:=Chart1.Tools.Add(TSeriesAnimationTool) as TSeriesAnimationTool;
  with animationTool do
  begin
    Duration:=250;
    Series:=Chart1[0];
    Play;
  end;
end;

procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
begin
  for i:=0 to Chart1[0].Count-1 do
    Chart1[0].YValue[i]:=Chart1[0].YValue[i] - 10;

  animationTool.Play;
end;


If you still find problems, please arrange a simple example project we can run as-is the problem here.
Best Regards,

ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image ImagePlease read our Bug Fixing Policy
Yeray
Site Admin
Site Admin
 
Posts: 8369
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia

Previous

Return to FMX

Who is online

Users browsing this forum: No registered users and 1 guest