Autosize of chart for 2D and 3D view options
Posted: 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.
In 2D this will go from some color to grey and in 3D mode this gradient displays correctly.
Thanks in advance.
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;
Thanks in advance.