Create a nice looking chart with CL_GUI_CHART_ENGINE – Part 1 – Chart Designer详解编程语言

At the beginning of my work with SAP I was disappointed with the charts that was available in standard transactions. In fact I am still :) But when I have to create own program with nice looking chart then it’s no longer a problem as we can use 
CL_GUI_CHART_ENGINE together with 
chart designer provided by SAP. Chart designer is a tool which allows you to create a customizing for your chart and save it in XML file which can be used in ABAP after.

So first of all we need to download chart designer from SDN so you can google “sap chart designer” to get it. After you’ll have it just run one of the versions available there (640 or 700) depending on your GUI version. All files which you’ll find in the package are shown below, XML Format.pdf file will tell you how to prepare chart data depending on chart type.
 
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言

When you run ChartDesigner you’ll se that there is a lot of chart types available for your use, surely you’ll find the one you need here. 
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
Step 1) For my article purpose I will use Pie2.5D type

 
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
Step 2) Let’s setup title, subtitle, number of series and categories. In title I will use string 
TITLE_REPLACE and for subtitle 
SUBTITLE_REPLACE to be able to easily replace it to dynamic texts during creation of chart in ABAP. I’ll set up 1 series and 3 categories for our demo.
 
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
Step 3) Here we can customize the colors for our categories and if we want to display labels or not. I will use text labels here.

 
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
Step 4) Here we can customize background, plot area, title, subtitle and legend styles:
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
For Background we can make it visible or not, set colors and gradients.
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
Same settings are available for Plot Area
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
For Title we can set up font size, font family, font color , font style and position.
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
Same we can do for Subtitle.
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
For Legend we can set if we want to have it on chart or not, its alignment and position.
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
Step 5) (Yeah I know it’s on the screen-shot as 6 ) Just the info that we finished.
 
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言
 
Step 6)  At the end we receive all customization in one place so we can adjust something if needed or jus save the XML using “File” menu.
 
Create a nice looking chart with CL_GUI_CHART_ENGINE - Part 1 - Chart Designer详解编程语言

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/20166.html

(0)
上一篇 2021年7月19日
下一篇 2021年7月19日

相关推荐

发表回复

登录后才能评论