FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.



May 23, 2018, 6:05 AM
41 Posts

Graph in Xpages

  • Category: Custom JSF code (Eclipse IDE)
  • Platform: All
  • Release: 9.0.1
  • Role: Developer
  • Tags: Graph
  • Replies: 1

Hi Team,

Thanks in advance for the help.

I tried to develop canvas graph in our x-pages application and below code are trying to use but unable to display data or preview on the .xsp page.

Same code use on normal lotus page or lotus form than working fine. Below is the code to use on .xsp.

I need some help what is the issues in this code to not support on the .xsp pages.


<html>
<head>  
<script>
window.onload = function () {

var chart = new CanvasJS.Chart("chartContainer", {
    animationEnabled: true,
    theme: "light2", // "light1", "light2", "dark1", "dark2"
    title:{
        text: "Top Oil Reserves"
    },
    axisY: {
        title: "Reserves(MMbbl)"
    },
    data: [{        
        type: "column",  
        showInLegend: true, 
        legendMarkerColor: "grey",
        legendText: "MMbbl = one million barrels",
        dataPoints: [      
            { y: 300878, label: "Venezuela" },
            { y: 266455,  label: "Saudi" },
            { y: 169709,  label: "Canada" },
            { y: 158400,  label: "Iran" },
            { y: 142503,  label: "Iraq" },
            { y: 101500, label: "Kuwait" },
            { y: 97800,  label: "UAE" },
            { y: 80000,  label: "Russia" }
        ]
    }]
});
chart.render();

}
</script>
</head>
<body>
<div id="chartContainer" style="height: 300px; width: 100%;"></div>
<script src="https://canvasjs.com/assets/script/canvasjs.min.js"></script>
</body>
</html>

 

 

 

May 23, 2018, 9:14 AM
26 Posts
If you look in the browser console do you see errors?
Use the browser console to step through the code, see where the error happens.

FORUM PLAN UPDATE
Date revision: This forum will remain open to new posts and responses until December 1, 2018. (After that date, you will still be able to view and search the forum.) Also, we're taking a second look at the best place to host future conversation. For now, keep using this forum, and stay tuned for more news.