When I'm graphing a single point, the area graph only shows a single dashed verticle line up the the value of the point.
Is there any way to change the display of the graph so it draws the single point from the bottom-left of the chart window to the point to the bottom-right of the chart window? This would then show a single point essentially as a pyramid. As it is, viewing a single data point sometimes confuses the customer because it looks like nothing was graphed.
Thanks
Area Graph Question
Hello mh,
To plot an area series you should have, at least, two points to define a valid area to be plotted. Anyway, if you wish to achieve what you request you could use something like the AddValue method and OnGetPointerStyle event (to show the points you need) as in the example we implemented below.
To plot an area series you should have, at least, two points to define a valid area to be plotted. Anyway, if you wish to achieve what you request you could use something like the AddValue method and OnGetPointerStyle event (to show the points you need) as in the example we implemented below.
Code: Select all
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, TeEngine, Series, ExtCtrls, TeeProcs, Chart, StdCtrls, TeeComma;
type
TForm1 = class(TForm)
Chart1: TChart;
Series1: TAreaSeries;
Button1: TButton;
TeeCommander1: TTeeCommander;
procedure FormCreate(Sender: TObject);
function Series1GetPointerStyle(Sender: TChartSeries;
ValueIndex: Integer): TSeriesPointerStyle;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
OnePoint: boolean;
procedure AddValue(y: double);
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.AddValue(y: double);
begin
if Series1.Count = 0 then
begin
OnePoint:=true;
Series1.Add(y-1);
Series1.Add(y);
Series1.Add(y-1);
end
else
begin
if OnePoint then
begin
Series1.Delete(0);
Series1.Delete(Series1.Count-1);
Series1.XValues.FillSequence;
OnePoint:=false;
end;
Series1.Add(y);
end;
end;
procedure TForm1.FormCreate(Sender: TObject);
begin
Series1.Clear;
Series1.Pointer.Visible:=true;
OnePoint:=false;
AddValue(random);
end;
function TForm1.Series1GetPointerStyle(Sender: TChartSeries;
ValueIndex: Integer): TSeriesPointerStyle;
begin
if OnePoint then
begin
if (ValueIndex = 1) then
result := psRectangle
else
result := psNothing;
end
else
result := psRectangle;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
AddValue(random);
end;
end.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Hi mh,
If you don't have access to all those events and properties in Report Builder you could use an invisible TChart, export it to an image and then load the image into Report Builder. For more information on how to export TeeChart to images please read Tutorial 12 - Exporting and Importing Charts. You'll find the tutorials at TeeChart's program group.
If you don't have access to all those events and properties in Report Builder you could use an invisible TChart, export it to an image and then load the image into Report Builder. For more information on how to export TeeChart to images please read Tutorial 12 - Exporting and Importing Charts. You'll find the tutorials at TeeChart's program group.
Best Regards,
Narcís Calvet / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |