Autosize of chart for 2D and 3D view options

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
Michael Heinrich
Newbie
Newbie
Posts: 20
Joined: Thu Feb 04, 2010 12:00 am

Autosize of chart for 2D and 3D view options

Post by Michael Heinrich » Mon Feb 15, 2010 2:50 pm

I have been tinkering with the TDBChart and have some questions I was unable to find in either the online help or on the board.

1) I have created a TDBChart at runtime, placed it on a panel which I have given some width and height values, and have set the chart's alignment to alClient. After I have populated the dataset with values and added series accordingly I would like to have the chart resize in both 3D mode as well as in 2D mode to fit both legend and chart in on screen. However after I display the chart the chart is zoomed in so far that I only see approx 20% of the chart. I have found out that by using TDBChart.View3DOptions.Zoomfactor I can alter the visible area but I was hoping this could be done automatically since all the charts that need to be displayed have different sets of series/data/ranges etc.

2) Why is the gradient of a chart ( TDBChart.Gradient ) overruled by a greyish colour when I like to set a gradient from yellow to white? When I set the gradient from yellow to red or any other color than white the gradient shows correctly but using white as a terminal color transforms the gradient into a greyish endpoint.

Code: Select all

    mDBChart.Gradient.Visible := True;
    mDBChart.Gradient.StartColor := lColor; // Some colour
    mDBChart.Gradient.EndColor := $FFFFFF; // White
    mDBChart.Gradient.Direction := gdDiagonalDown;
In 2D this will go from some color to grey and in 3D mode this gradient displays correctly.

Thanks in advance.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Autosize of chart for 2D and 3D view options

Post by Narcís » Mon Feb 15, 2010 3:31 pm

Hi Michael,

1. This is very strange. I wouldn't expect this to happen. Can you please attach a simple example project we can run "as-is" to reproduce the problem here?

2. It works fine for me here using this code:

Code: Select all

uses TeCanvas, TeeJPEG;

procedure TForm4.FormCreate(Sender: TObject);
begin
  Chart1.Gradient.Visible := True;
  Chart1.Gradient.StartColor := RGB(120, 34, 123); // Some colour
  Chart1.Gradient.EndColor := $FFFFFF; // White
  Chart1.Gradient.Direction:= gdDiagonalDown;

  Chart1.View3D:=false;
end;
That's what I get in 2D and 3D using our latest v8 sources:
2DGradient.jpg
2D chart
2DGradient.jpg (19.26 KiB) Viewed 6932 times
3DGradient.jpg
3D chart
3DGradient.jpg (20.01 KiB) Viewed 6948 times
Which Teechart version are you using? Can you post an image of what you get?

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Michael Heinrich
Newbie
Newbie
Posts: 20
Joined: Thu Feb 04, 2010 12:00 am

Re: Autosize of chart for 2D and 3D view options

Post by Michael Heinrich » Mon Feb 15, 2010 3:55 pm

I am using the version Build 8.06.60902 taken from the release.txt
I am currently trying to reproduce this in a version without the use of devexpress components but still with runtime created TDBCharts.
I will post my example as soon as possible/

Michael Heinrich
Newbie
Newbie
Posts: 20
Joined: Thu Feb 04, 2010 12:00 am

Re: Autosize of chart for 2D and 3D view options

Post by Michael Heinrich » Tue Feb 16, 2010 8:19 am

After making a standard application I found out that without a TeeOpenGL component attached to the Chart, the chart will paint just fine (will show entire chart and legend/lines/axes correctly). However when I add the TeeOpenGL to the chart this will somehow make the chart viewing area incorrect.
When I set the TeeOpenGL to inactive the chart is painted correctly and the background gradient is painted correctly as well. When I reactivate the TeeOpenGL the chart is painted incorrectly. Somehow the viewing area is incorrectly determined when using the component.
Do I need to install a specific version of OpenGL or other software to make this work?

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Autosize of chart for 2D and 3D view options

Post by Narcís » Tue Feb 16, 2010 9:45 am

Hi Michael,

I'm not sure if some graphic cards with better OpenGL built-in capabilities would handle this. Anyway, I think this is a bug which I have added to the defect list (TV52014687) to be fixed for future releases.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply