Chart.js does not work in Jenkins views due to conflict with (old) bundled prototype.js in Stapler

289 views
Skip to first unread message

Ullrich Hafner

unread,
Jan 27, 2018, 6:03:31 PM1/27/18
to Jenkins Developers
I’m trying to add some modern graphs in my plug-ins but only a few of them are shown correctly in Jenkins.
Did someone already integrate Chart.js successfully in a plug-in?

Is there a way to disable protoype on a page?

Why are we bundling such an old version? Jenkins: 1.6.0.2 (released in 2008), Latest 1.7.3 (released in 2015)

E.g. if I integrate the hello wold graph (http://www.chartjs.org/docs/latest/#creating-a-chart) I get a JS error:

TypeError: ticks is undefined[Weitere Informationen] Chart.bundle.js:12479:8
linear https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:12479:8
collect/< http://localhost:8080/jenkins/static/0bda7fbb/scripts/prototype.js:893:20
each/< http://localhost:8080/jenkins/static/0bda7fbb/scripts/prototype.js:853:9
forEach self-hosted:271:13
each http://localhost:8080/jenkins/static/0bda7fbb/scripts/prototype.js:852:7
collect http://localhost:8080/jenkins/static/0bda7fbb/scripts/prototype.js:892:5
convertTicksToLabels https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:11652:15
convertTicksToLabels https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:17066:4
update https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:11554:13
getMinimumBoxSize https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:10706:16
each https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:14328:6
update https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:10717:4
updateLayout https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:8560:4
update https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:8517:4
construct https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:8275:4
Chart https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.7.1/Chart.bundle.js:10500:3
<anonym> http://localhost:8080/jenkins/job/Pipeline/3/checkstyleResult/:16:23
<anonym> http://localhost:8080/jenkins/job/Pipeline/3/checkstyleResult/:14:10



signature.asc

Ullrich Hafner

unread,
Feb 1, 2018, 3:44:51 PM2/1/18
to Jenkins Developers
For the record if someone else tries to use Chart.js:


Workaround:
replace war/scripts/prototype.js in JENKINS_HOME with the latest release 1.7.3
signature.asc
Reply all
Reply to author
Forward
0 new messages