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.
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.
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.
Step 1) For my article purpose I will use Pie2.5D type
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.
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.
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.
Step 4) Here we can customize background, plot area, title, subtitle and legend styles:
For Background we can make it visible or not, set colors and gradients.
Same settings are available for Plot Area
For Title we can set up font size, font family, font color , font style and position.
Same we can do for Subtitle.
For Legend we can set if we want to have it on chart or not, its alignment and position.
Step 5) (Yeah I know it’s on the screen-shot as 6 ) Just the info that we finished.
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.
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/20166.html