question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Script is not working with attached HTML (Chart)

See original GitHub issue

Hello

I want to have a line chart and bar chart in my generated PDF but somehow script is not working with attached HTML.

I am using below chart script in my HTML code (only script part is here, its Incomplete code)

<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.5.0/Chart.min.js"></script>
<body>
<canvas id="myChart" style="width:100%;max-width:600px"></canvas>
<script>var xValues=["Italy","France","Spain","USA","Argentina"];var yValues=[55,49,44,24,15];var barColors=["red","green","blue","orange","brown"];new Chart("myChart",{type:"bar",data:{labels:xValues,datasets:[{backgroundColor:barColors,data:yValues}]},options:{legend:{display:false},title:{display:true,text:"World Wine Production 2018"}}});</script>

Could please help, how to achieve that?

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:10

github_iconTop GitHub Comments

1reaction
suresh-boradcommented, Mar 4, 2022

Hey @suresh-borad the script is functional but due to some reason the Chart is not visible in the pdf. Could this be because of the use of.

Yes, @OmSingh5092 I had the same issue with android and I’m using Google Chart lib in HTML. After these changes, it’s working fine.

The iOs was working fine without any changes but the issue with android.

1reaction
suresh-boradcommented, Mar 3, 2022
Read more comments on GitHub >

github_iconTop Results From Across the Web

Chart.js not working on my page? - Stack Overflow
The reason may be that you are using the latest chart.min.js but using the old code. For correct reference, follow the chartjs.org documentation....
Read more >
Office Script not working properly when file is not opened
Once script is triggered a chart is sent back to flow . It works perfectly when excel file is kept opened but fails...
Read more >
Handling common JavaScript problems - MDN Web Docs
Fixing general JavaScript problems. As we said in the previous article on HTML/CSS, you should make sure your code is working generally, ...
Read more >
JavaScript: chart.js 2.0 - Claris Community
If you put the JS in a global text field, the WV-Charts will also work offline ... may not work. there may be...
Read more >
D3.js - Data-Driven Documents
D3 is a JavaScript library for visualizing data with HTML, SVG, and CSS. ... Instead, D3 solves the crux of the problem: efficient...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found