1

Trying to get Flot chart to render using IronPDF and razor pages but having no luck. I have the following jQuery in my razor page:

enter image description here

Here is my div:

<div id="flotChart" style="width:100%;height:300px"></div>

Enabled javascript for IronPDF:

Renderer.PrintOptions.EnableJavaScript = true;
Renderer.PrintOptions.RenderDelay = 500; //milliseconds

however nothing ever gets generated in the PDF.

john
  • 3,949
  • 7
  • 34
  • 56

2 Answers2

0

Try running exactly the same code on IronPdf with their new 2021 Chrome identical rendering engine.

It has much more modern JS parsing and allows more memory for JS execution.

It has worked for me for charting, jQuery and Angular.

Stephanie
  • 600
  • 13
  • 24
-1

I am a technician for Iron Software. We are currently working on a major upgrade to our rendering engine that should make Flot charts more compatible.

In the meantime, we recommend D3/C3 as a good general fit, though newer versions of D3/C3 cause an issue so please see the code below for ideas.

Other customers have also reported success using Highcharts and Google Charts.

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>C3 Bar Chart</title>
</head>
<body>
<div id="chart" style="width: 950px;"></div>
<script src="https://d3js.org/d3.v4.js"></script>

<!-- Load c3.css -->
<link href="https://cdnjs.cloudflare.com/ajax/libs/c3/0.5.4/c3.css" rel="stylesheet">

<!-- Load d3.js and c3.js -->
<script src="https://cdnjs.cloudflare.com/ajax/libs/c3/0.5.4/c3.js"></script>

<script>
Function.prototype.bind = Function.prototype.bind || function (thisp) {
var fn = this;
return function () {
return fn.apply(thisp, arguments);
};
};

var chart = c3.generate({
bindto: '#chart',
data: {
columns: [
['data1', 30, 200, 100, 400, 150, 250],
['data2', 50, 20, 10, 40, 15, 25]
]
}
});
</script>
</body>
</html >

I hope this helps to point you in the right direction.

18612835
  • 1
  • 5