Dashboard Functionality
Dashboard Functionality
I'm looking to use the dashboard component but can't find much in the way of documentation.
Specifically I would like to:
Print the entire dashboard and all its charts.
Load and Save editor settings.
Add charts at runtime to the dashboard.
Any clues where to look please?
Specifically I would like to:
Print the entire dashboard and all its charts.
Load and Save editor settings.
Add charts at runtime to the dashboard.
Any clues where to look please?
Re: Dashboard Functionality
Hello,
There are a couple of tickets reporting issues about the Dashboard not saving some properties into the .dfm. In case this is what you are finding problems with:
http://bugs.teechart.net/show_bug.cgi?id=1314
http://bugs.teechart.net/show_bug.cgi?id=1315
I've seen the positions and the size of the charts seems to be lost when printing. I'll be back to you asap.OSNick wrote:Print the entire dashboard and all its charts.
Note the TDashBoard is basically a TChart with a TSubChartTool. It is designed so you can easily add SubCharts to the DashBoard.OSNick wrote:Load and Save editor settings.
There are a couple of tickets reporting issues about the Dashboard not saving some properties into the .dfm. In case this is what you are finding problems with:
http://bugs.teechart.net/show_bug.cgi?id=1314
http://bugs.teechart.net/show_bug.cgi?id=1315
Ie:OSNick wrote:Add charts at runtime to the dashboard.
Code: Select all
procedure TForm1.FormCreate(Sender: TObject);
begin
DashBoard1.AddChart('Chart1').AddSeries(TBarSeries).FillSampleValues;
DashBoard1.AddChart('Chart2').AddSeries(TLineSeries).FillSampleValues;
DashBoard1.AddChart('Chart2').AddSeries(TPieSeries).FillSampleValues;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dashboard Functionality
Hello,
http://bugs.teechart.net/show_bug.cgi?id=1554
We have a fix in the works.
I've added this to the public tracker:Yeray wrote:I've seen the positions and the size of the charts seems to be lost when printing. I'll be back to you asap.
http://bugs.teechart.net/show_bug.cgi?id=1554
We have a fix in the works.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dashboard Functionality
Hello,
The fix consists on:
We've just closed the ticket.Yeray wrote:I've added this to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1554
The fix consists on:
Code: Select all
--- a/TeeSubChart.pas
+++ b/TeeSubChart.pas
@@ -17,6 +17,11 @@ uses
{$IFDEF FMX}
FMX.Types, System.UITypes,
+
+ {$IFDEF D19}
+ FMX.Graphics,
+ {$ENDIF}
+
{$IFDEF D17}
System.UIConsts,
{$ENDIF}
@@ -382,20 +387,57 @@ begin
end;
+type
+ TCustomTeePanelAccess=class(TCustomTeePanel);
+
procedure TSubChartTool.ChartEvent(AEvent: TChartToolEvent);
+
+ {$IFNDEF FMX}
+ procedure ApplyMetaScale(var R:TRect);
+ var tmp : TRect;
+ tmpR : TRect;
+ tmpW,
+ tmpH,
+ tmpX,
+ tmpY : Single;
+ begin
+ tmp:=ParentChart.ChartPrintRect;
+ tmpR:=ParentChart.GetRectangle;
+
+ tmpW:=(tmpR.Right-tmpR.Left);
+ tmpX:=(tmp.Right-tmp.Left)/tmpW;
+
+ R.Left:=Round(R.Left*tmpX);
+ R.Right:=Round(R.Right*tmpX);
+
+ tmpH:=(tmpR.Bottom-tmpR.Top);
+ tmpY:=(tmp.Bottom-tmp.Top)/tmpH;
+
+ R.Top:=Round(R.Top*tmpY);
+ R.Bottom:=Round(R.Bottom*tmpY);
+ end;
+ {$ENDIF}
+
var t : Integer;
+ tmp : TCanvas;
+ tmpR : TRect;
+
+ {$IFNDEF FMX}
+ tmpScale : Boolean;
+ {$ENDIF}
begin
inherited;
if Active and (AEvent=cteAfterDraw) and Assigned(ParentChart) then
- for t:=0 to Charts.Count-1 do
- with Charts[t] do
- if Chart.Visible then
- begin
- // NOT A GOOD IDEA: Chart.View3D:=Self.ParentChart.View3D;
+ begin
+ tmp:=ParentChart.Canvas.ReferenceCanvas;
+
+ {$IFNDEF FMX}
+ tmpScale:=ParentChart.Printing and
+ ParentChart.Canvas.Metafiling and
+ TCustomTeePanelAccess(ParentChart).IsPrinterCanvas;
+ {$ENDIF}
+
- Chart.BufferedDisplay:=False;
- Chart.Draw(Self.ParentChart.Canvas.ReferenceCanvas,Bounds);
- end;
+ for t:=0 to Charts.Count-1 do
+ with Charts[t] do
+ if Chart.Visible then
+ begin
+ Chart.BufferedDisplay:=False;
+
+ tmpR:=Bounds;
+ OffsetRect(tmpR,ParentChart.ChartBounds.Left,
+ ParentChart.ChartBounds.Top);
+
+ {$IFNDEF FMX}
+ if tmpScale then
+ ApplyMetaScale(tmpR);
+ {$ENDIF}
+
+ Chart.Draw(tmp,tmpR);
+ end;
+ end;
end;
procedure TSubChartTool.ChartMouseEvent(AEvent: TChartMouseEvent;
@@ -1168,9 +1171,6 @@ end;
{ TChartCollection }
-type
- TCustomTeePanelAccess=class(TCustomTeePanel);
-
function TChartCollection.AddChart(const AName: String=''): TChart;
var tmp : TCustomTeePanel;
begin
--
--
Code: Select all
--- a/TeeProcs.pas
+++ b/TeeProcs.pas
@@ -439,6 +439,7 @@ type
FCustomChartRect : Boolean;
IsEmbedded : Boolean;
InternalCanvas : TCanvas3D;
+ IsPrinterCanvas : Boolean;
Procedure ApplyMargins;
@@ -3591,7 +3592,9 @@ begin
// FMX TODO: Change Scale.X and Y
SetAnisotropic;
+
FPrinting:=True;
+ IsPrinterCanvas:=True;
try
if CanClip then ClipCanvas(PrintCanvas,tmpR);
@@ -3601,6 +3604,7 @@ begin
DrawToMetaCanvas(PrintCanvas,tmpR);
UnClipCanvas(PrintCanvas);
finally
+ IsPrinterCanvas:=False;
FPrinting:=False;
end;
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dashboard Functionality
Thanks for the update (just got back onto this). Is it possible to have an updated .pas please? I'm always nervous about editing your source files.
Re: Dashboard Functionality
Hello,
I've just sent you a mail with the modified units.
I've just sent you a mail with the modified units.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dashboard Functionality
Thank you for sending the units. Unfortunately I am using version 'Teechart Pro 2014 Components' (as I couldn't install the latest version). The units you send give compilation errors
Could I have the 2014 versions please?
Could I have the 2014 versions please?
Re: Dashboard Functionality
Hello,
I'm not sure if it will be possible. v2014.11 or v2014.12?OSNick wrote:Could I have the 2014 versions please?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Dashboard Functionality
v2014.12 is my version.
I tried re-installing the latest version into D2007, but I get errors loading Delphi - cannot load bpl files.
I tried re-installing the latest version into D2007, but I get errors loading Delphi - cannot load bpl files.
-
- Site Admin
- Posts: 14730
- Joined: Mon Jun 09, 2003 4:00 am
- Location: Banyoles, Catalonia
- Contact:
Re: Dashboard Functionality
HI OSNick,
Which exact error message(s) do you get?
BTW, this thread may help setting up your environment.
Which exact error message(s) do you get?
BTW, this thread may help setting up your environment.
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 |