콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
1 회신
3945 화면

Hi Guys, i have used canvas for plotting pie chart in Report.

So if I am seeing it as qweb-html, its rendering correctly.



But in PDF it not loading:



In PDF it's not rendering.

Any idea, how can i get this pie chart in my PDF.

Code:

<div class="page">
<script type="text/javascript">
window.onload = function() {
var chart = new CanvasJS.Chart("chartContainer", {
animationEnabled: true,
title: {
text: "Desktop Search Engine Market Share - 2016"
},
data: [{
type: "pie",
startAngle: 240,
yValueFormatString: "##0.00\"%\"",
indexLabel: "{label} {y}",
dataPoints: [
{y: 79.45, label: "Google"},
{y: 7.31, label: "Bing"},
{y: 7.06, label: "Baidu"},
{y: 4.91, label: "Yahoo"},
{y: 1.26, label: "Others"}
]
}]
});
chart.render();
}
</script>
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
아바타
취소
베스트 답변

Javascript not working in qweb pdf, you need to do it outside qweb in python function

Thanks

아바타
취소
작성자

Do you have seen this type of thing anywhere in odoo?

작성자

Any Example

Unfortunately, I don't have an example because it is complicated to do it. You need to combine python with javascript and qweb

관련 게시물 답글 화면 활동
1
11월 24
1142
PDF reports 해결 완료
5
7월 25
2248
Wrong PDF Format 해결 완료
2
3월 24
2768
0
11월 22
2984
0
9월 17
5296