Hi,
I've a problem to export from VCL to HTML JScript.
When I don't use automatique increment, the labels of Bottom Axis are not visible.
You can find the application in attachement.
Is there a common code between VCL Export HTML5 JSCript and JSCript component?
Export as HTML5 JScript
Export as HTML5 JScript
- Attachments
-
- ExportHtml5.zip
- (53.1 KiB) Downloaded 1316 times
Re: Export as HTML5 JScript
Hello,
I could reproduce the problem, so I added a ticket in the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1630
I also fixed it for the next maintenance release.
Since you own the sources, you can apply the fix by changing the following lines in the EmitAxis method in TeeJavaScript.pas:
For these:
Also note in your bottom axis I see you've set DateTimeFormat as 'dd/MM/yyyy HH:MM' but the character to represent minutes is "n" in delphi, while "m" is used for months (reference here). So I'd change it for this:
I could reproduce the problem, so I added a ticket in the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1630
I also fixed it for the next maintenance release.
Since you own the sources, you can apply the fix by changing the following lines in the EmitAxis method in TeeJavaScript.pas:
Code: Select all
procedure EmitAxis(Tag:String; const Axis:TChartAxis);
//...
begin
if not TChartAccess(Chart).CalcIsAxisVisible(Axis) then
Exit;
if Minify then NewLocalVar(Tag);
if not TChartAccess(Chart).CalcIsAxisVisible(Axis) then
AddScript(Tag+'.visible='+ToBool(False)+';');
if Axis.Inverted then
AddScript(Tag+'.inverted='+ToBool(True)+';');
if Axis.Logarithmic then
AddScript(Tag+'.log='+ToBool(True)+';');
if Axis.Increment<>0 then
AddScript(Tag+'.increment='+FloatToStr(Axis.Increment)+';');
Code: Select all
procedure EmitAxis(Tag:String; const Axis:TChartAxis);
//...
var tmpS: string;
begin
if not TChartAccess(Chart).CalcIsAxisVisible(Axis) then
Exit;
if Minify then NewLocalVar(Tag);
if not TChartAccess(Chart).CalcIsAxisVisible(Axis) then
AddScript(Tag+'.visible='+ToBool(False)+';');
if Axis.Inverted then
AddScript(Tag+'.inverted='+ToBool(True)+';');
if Axis.Logarithmic then
AddScript(Tag+'.log='+ToBool(True)+';');
if Axis.Increment<>0 then
if Axis.IsDateTime then
AddScript(Tag+'.increment='+FloatToStr(86400000*Axis.Increment)+';')
else
AddScript(Tag+'.increment='+FloatToStr(Axis.Increment)+';');
if Axis.IsDateTime then
begin
tmpS:=LowerCase(Axis.DateTimeFormat);
tmpS:=StringReplace(tmpS, 'n', 'M', [rfReplaceAll]);
AddScript(Tag+'.labels.dateFormat="'+tmpS+'";');
end;
Code: Select all
Chart1.Axes.Bottom.DateTimeFormat:='dd/MM/yyyy HH:nn';
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Export as HTML5 JScript
Hi,
thank you very much for the patch!
It works better now!
Would-it possible like in vcl chart to limit automaticaly the number of legend displayed?
thank you very much for the patch!
It works better now!
Would-it possible like in vcl chart to limit automaticaly the number of legend displayed?
- Attachments
-
- ChartWeb.png (43.18 KiB) Viewed 18752 times
-
- ChartVcl.png (13.84 KiB) Viewed 18753 times
Re: Export as HTML5 JScript
Hello,
There may be some difference on how both versions handle the increment in the axis. Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
This seems to be the bottom axis labels, not the legend.Menant.D wrote:Would-it possible like in vcl chart to limit automaticaly the number of legend displayed?
There may be some difference on how both versions handle the increment in the axis. Could you please arrange a simple example project we can run as-is to reproduce the problem here?
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Re: Export as HTML5 JScript
You're right, it concern labels of bottom Axe.
The difference is where we put an increment(one day for example) in automatic increment.
You can see it in the project join.
The difference is where we put an increment(one day for example) in automatic increment.
You can see it in the project join.
- Attachments
-
- ExportHtml5_2.zip
- (56.84 KiB) Downloaded 1298 times
Re: Export as HTML5 JScript
Hello,
This is because the increment property in TeeChart HTML5 is a bit different than in TeeChart VCL.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1632
This is because the increment property in TeeChart HTML5 is a bit different than in TeeChart VCL.
I've added it to the public tracker:
http://bugs.teechart.net/show_bug.cgi?id=1632
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |