Heuristic wrote:
However for our purposes we may have a different number of series and as such need to be able to iteratively set their shadow visibility to false. I am new to JavaScript and attempted the following code which does not work:
Code: Select all
for (var i=0; i < Chart1.SeriesList.count(); i++)
{
Chart1.getSeries(i).format.shadow.visible = false;
}
Try with this:
Code: Select all
Chart1.series.each(function(s) {
s.format.shadow.visible = false;
});
Or, alternativelly:
Code: Select all
for (var i=0; i<Chart1.series.items.length; i++) {
Chart1.series.items[i].format.shadow.visible = false;
};
Heuristic wrote:On the DateTime issue I've attempted your by code fix (we are using C++ builder)
Code: Select all
TJavascriptExportFormat* jscriptExp = new TJavascriptExportFormat;
jscriptExp->SaveToFile(Chart, FileName);
And we are getting the same result when using TeeSaveToJavaScript(Chart,FileName, 500, 500, false);
In regards to version, I'm not sure if this is exactly what you're looking for but the file I'm using is 'VCLTee.TeeJavaScript.pas' rev: 31.00 (Windows)
DateTime values weren't correctly exported from TeeChart VCL to JavaScript as reported in the ticket
#1630. The fix for this ticket was included in TeeChart VCL v2016.19.
If you are using a TeeChart version older than that, you can upgrade to a newer version, or do the necessary modifications in the JavaScript result.
These modifications in the JavaScript result consist on:
- If you have any axis in your TeeChart VCL chart, with Increment<>0 and with IsDateTime set to true, search for the increment property in your JavaScript output, and multiply for 86400000. This is how the exporter does it:
Code: Select all
if Axis.Increment<>0 then
if Axis.IsDateTime then
AddScript(Tag+'.increment='+FloatToStr(86400000*Axis.Increment)+';')
else
AddScript(Tag+'.increment='+FloatToStr(Axis.Increment)+';');
- If you have any axis in your TeeChart VCL chart, with IsDateTime set to true, add a line to your JavaScript output with the corresponding DateTimeFormat. This is how the exporter does it:
Code: Select all
if Axis.IsDateTime then
begin
tmpS:=LowerCase(Axis.DateTimeFormat);
tmpS:=StringReplace(tmpS, 'n', 'M', [rfReplaceAll]);
AddScript(Tag+'.labels.dateFormat="'+tmpS+'";');
end;