Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Upender Kumar
Mega Sage

Hi All, this is first article and sharing my experience (code and steps) to create a service portal widget having charts using HighChart.js  so that other community users can get benefits.

My requirement was to create a service portal page to show dashboards (graphs) tickets having pending state in number of days.

Below are screen shots. I have also attached .xml file for this.

1. I created a service portal widget below are sections.

2. Added dependencies.

find_real_file.png

HTML Template

find_real_file.png

Client Script

find_real_file.png Server Controller

I have hard coded values here you can get data from database compute you data and can assign values.

find_real_file.png

 

CSS

find_real_file.png

Out Put

find_real_file.png

 

 

 

Comments
Sandeep10
Giga Contributor

Please provide more such type of articles.

Ram_n Botelho
Tera Contributor

How can I use this kind of graph, which does not have the chart.type element?


Organization Chart

LaibaR
Tera Contributor

Hi  Upender Kumar! Hope you're doing well, I want help, I am trying to show Bar Chart on Widgets Preview, I've tried code from this website : https://jtblin.github.io/angular-chart.js/
I added dependencies in My HTML also in  Widget> Dependencies> Js Include
Still, I can't see bar chart on preview, let me know If I am wrong, Help me

Version history
Last update:
‎03-20-2018 09:14 AM
Updated by: