Jump to content

Problems with TUniHTMLFrame and Chart.js


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 post
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 post
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 post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...