如何在SAP WebClient UI裡建立柱狀圖(bar chart)
Recently I am asked by my manager to give him a report containing the number of open, in process and closed tickets assigned to my responsible component. Since I am learning Javascript recently, I decide not to achieve the report via excel but choose Javascript instead. Here below is the Bar chart created via a third party Javascript library jChartFX. You can download the library and example from this link.
You can follow this document to create Bar Chart and embed it in your CRM system.
(1) Upload necessary Javascript file and css file into mime repository
Although there are lots of js and css file in the downloaded library, in this sample only 8 of them are needed:
You can find all of them from attached file, just rename JChartLib.zip.txt as JChartLib.zip and unzip it.
Go to SE80 mime repository, follow the path “/bc/bsp/sap/crm_ui_frame” to find folder “CRM_UI_FRAME”. Create a folder “jchart” under it via context menu Create->Folder:
Then click on folder jchart and choose “Create->MIME Object” from context menu, maintain Mime Type as “application/x-javascript” and click Start Editor button:
The notepad application is automatically launched, and just copy the source code of JavaScript file from the zip file of this document.
Repeat the operation ans ensure all the 8 files are created in mime repository correctly. ( The mime type for css file is “text/css”) Once done, it looks like below:
(2) Create a new UI component and draw Bar Chart there
copy the source code of file main.html from attachment into the empty view you just created in UI component:
A brief explanation on the source code of main.html
- line18: create a new chart instance
- line19: position the chart into html element with ID = divChart1
- line20: set chart type as Bar
- line21: feed the chart with JSON data
- line22: enable 3D effect to make the chart look more fancy
- line23~25: set title
line28~line73: hard code the JSON data stream for chart line81~line112: since I am not happy with the default color defined in css file, so I redefine them here. So far, the development of webclient UI component is finished.
(3) Create a new work center and put the UI component into it
Please find step by step about how to achieve it from this link. Feel free to adapt the source code of this sample to meet with your own requirement.
Update on 2017-05-27
The same step could be performed to integrate other third party JavaScript libraries to WebClient UI framework, see another example from this blog Display count down in WebClient UI.
要獲取更多Jerry的原創文章,請關注公眾號"汪子熙":
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/24475491/viewspace-2719119/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 如何在SAP WebClient UI裡使用jChartFXWebclientUI
- 如何在SAP WebClient UI裡使用HANA Live reportWebclientUI
- 如何在 WebClient UI 裡建立 Value HelpWebclientUI
- 如何在CRM WebClient UI裡使用HANA Live ReportWebclientUI
- 在SAP WebClient UI裡顯示倒數計時的UIWebclientUI
- 在SAP CRM WebClient UI裡開啟ABAP Webdynpro頁面WebclientUI
- SoviChart資料視覺化:條形圖(Bar chart)視覺化
- SAP Fiori和WebClient UI的有狀態和無狀態行為設計原理WebclientUI
- SAP UI5 Smart Chart 功能介紹UI
- 使用note++開發SAP WebClient UIWebclientUI
- SAP WebClient UI的白屏問題分析WebclientUI
- SAP CRM WebClient UI和Fiori UI混搭並存WebclientUI
- SAP WebClient UI overview頁面裡assignment block的可見性分析技巧WebclientUIViewBloC
- 在SAP WebClient UI裡使用AJAX進行非同步資料讀取WebclientUI非同步
- SAP WebClient UI的會話重啟原理WebclientUI會話
- SAP UI5 應用開發教程之六十一 - 在 SAP UI5 應用裡繪製甘特圖 Gantt Chart 試讀版UI
- SAP CRM WebClient UI和Hybris backoffice UI開發的相同點WebclientUI
- SAP WebClient UI One Hit Navigation的實現方法WebclientUINavigation
- Jerry答網友提問:SAP CRM WebClient UI裡的EXT,STRUCT等含義WebclientUIStruct
- SAP CRM WebClient UI上將text area裡的文字清空的後臺處理WebclientUI
- 在SAP CRM WebClient UI中用javascript觸發ABAP eventWebclientUIJavaScript
- 使用Selenium自動化測試SAP CRM WebClient UIWebclientUI
- SAP CRM WebClient UI異常的持久化機制WebclientUI持久化
- 將SAP CRM WebClient UI的表格匯出成PDFWebclientUI
- 自己實現一個SAP WebClient UI Repository Information SystemWebclientUIORM
- 如何將SAP WebClient UI的表格匯出成PDFWebclientUI
- SAP WebClient UI component模型後設資料解析工具WebclientUI模型
- 如何自行分析SAP WebClient UI開發環境裡丟擲的錯誤訊息根源WebclientUI開發環境
- SAP UI5 應用開發教程之五十九 - 如何在 SAP UI5 應用裡顯示世界地圖試讀版UI地圖
- SAP WebClient UI配置決定(configuration)的邏輯介紹WebclientUI
- 使用SAP Transaction Launcher將ABAP Webdynpro嵌入到WebClient UI中WebclientUI
- SAP CRM WebClient UI的Delta處理機制介紹WebclientUI
- SAP WebClient UI component context node class單元測試方法WebclientUIContext
- SAP CRM WebClient UI和ABAP Webdynpro頁面的互相跳轉WebclientUI
- SAP CRM WebClient UI html 格式的 Text 顯示邏輯WebclientUIHTML
- SAP CRM WebClient UI 支援的一些 url 引數WebclientUI
- 如何在SAP Kyma的控制檯裡擴充套件新的UI套件UI
- 如何在 SAP 電商雲 Spartacus UI 裡新建一個頁面UI