External Libraries in Code Mode

Renato Marcello dos Reis shared this question 16 days ago
Answered

Hi Guys,


I hope everything is fine with all you from Yellowfin support.


I have a Javascript Chart from which I need to allow our users to take screenshots using Yellowfin Feature. Sadly, this feature does only work with Yellowfin charts.


As I'm in a need of some kind of chart Yellowfin does not provide, I created an JS Chart to fulfill my needs, but I will also need to create a workaround to screenshots feature. I was thinking to use html2canvas, but I don't know how to add external libraries in code mode.


Can someone point me into the right direction?


Thanks in advance.


Regards,


Renato Marcello

Comments (5)

photo
1

Hi Renato,


Thanks for your question.


I'm not entirely sure if this will work for you, however, have you tried adding the Javascript library in the require function of the Javascript Chart? You could also try adding a require function call in the onRender() function of the Dashboard. I have attempted this with another library for displaying LaTeX notation.


/341d6dc8864d9f74c690a8550d8ede79

Let me know if this helps.


Kind regards,

Simon

photo
1

Hi Renato,


I wanted to check in with you to see how you are travelling with this question.


Let me know if the resolution below worked in your case, and if you have any further questions.


Otherwise, I will shortly go ahead and close this ticket.


Kind regards,

Simon

photo
1

Hi Simon,

Sorry for the delay here, I had some issues that had to be solved asap, and I couldn't read your answer until today.

The "require" function used in your example couldn't help because the specific kind of code I need can only be achieved directly in Code Mode on my dashboard. However, I didn't knew where to put the script source in Code Mode. The answer to this, was to put right below the "canvas" tag in html.

We can also use the require in JS, but I think it's more usual to just put in html.

Thanks a lot for your help in this case.

Regards,

Renato Marcello

photo
1

Hi Renato,


Yes fundamentally the placement of the script tag should be the same, just to clarify - has this resolved your issue for the Code Widget, or do you still require assistance?


Kind regards,

Simon

photo
1

Hi Simon,

I just wanted to thank you once more. You can close this topic. It's very clear to me how we need to work with code mode now.

Regards,

Renato Marcello