Jump to content

Problems with TUniHTMLFrame and Chart.js


MarBar77

Recommended Posts

Hi,

 

I have 2 issues regarding using chart.js in TUniHTMLFrame. Maybe someone can help.

 

Below is link to download simple example.

 

https://1drv.ms/u/s!AtP5BtucE5MeioIwGecaHHSy_0FdMQ

 

Issue 1: Loading HTML from index.html file does not work correctly. The loaded file is not displayed or not displayed correctly. Only when i reloed the file for few times then content is displayed correctly in UniHTMLFrame (click few times button LoadChart to get result like in index.html file, which is located in exe directory).

 

Issue 2: When you load index.html directly in the browser then mouse scroll makes chart zooming, but when i load index.html to TUniHtmFrame then zooming is not working.

 

If someone can download it and give me some tips what is wrong with it?

 

Marcin

 

Link to comment
Share on other sites

I have found that this example works fine with TUniURLFrame, when I add HTML text to its HTML property.

 

But unfortunatelly I am declaring some JS functions in HTML, which works with TUniHTMLFrame and does not work with TUniURLFrame.

 

So, displaying and zooming is working fine in TUniURLFrame, and declaring functions is working with TUniHTMLFrame. No one is working good enough for me. Any suggestions?

 

 

Link to comment
Share on other sites

  • 3 months later...

The example was not working for me.

What I did.

 

1) Remove backslash before index.html. 

chartFrame.HTML.LoadFromFile(ExtractFilePath(Application.ExeName)+'\index.html');

 

2) On ServerModule, move the strings below in CustomCSS to CustomFiles.

/files/Chart.js
/files/chartjs-plugin-zoom.min.js
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...