How can we create a Pie Chart or Bar Chart using Portlet

How can we create a Pie chart or Bar chart in-home dashboard using Portlet script.

Rookie Asked on February 9, 2021 in SuiteScript.
Add Comment
2 Answer(s)

Create an HTML page that contains the container for the charts and reference to Google Charts and save it in the file cabinet and then reference the file id and use getContents function to use it in the portlet using params.portlet.html = htmlContent where htmlContent = fileObj.getContents();

Beginner Answered on February 9, 2021.
Add Comment

Hi

var content = ‘<body>’+
‘<form>’ +
‘ <fieldset>’+
‘ <legend>Selecting elements </legend> ‘ +
‘<div id=”chartContainer”>’+
‘<p> <label>Select Range</label> <select id = “myList”><option value = “1”>Daily</option> <option value = “2”>Weekly</option>’+

‘ </select>’ +
‘ </p>’ +

‘ </fieldset>’ +

‘</form>’ +
‘ </body>’;
params.portlet.html = content;

How can we add pie chart to the html, can you please send me do you have any sample code for this.

Rookie Answered on February 9, 2021.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   Limebox   Become a Sponsor