Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PIE Chart

bhargava_dns
Participant
0 Likes
2,839

Hi everybody,

One of the client i am working for has the following requirement.

1. Draw a pie chart

2. Display it in adobe forms.

I was able to draw a pie chart using the FM  "GFW_PRES_SHOW" but i am unable to dip lay the percentage

against the color in the chart...please let me how to display the percentage...if it is not possible using the above

FM please let me know alternative way how to achieve this.

     pleas also let me know how to add this pie chat to the adobe forms.I have searched a lot over net but could not

find a suitable solutions.

Thanks

Bhargava

10 REPLIES 10
Read only

Former Member
0 Likes
2,438


Hi Bhargava,

Have a look at program GFW_PROG_PIE.

This will help you to partition the colour based on your percenatge . (Copy this program and customize it . change the values in the form FILL_DC in your customized program.

Regards,

Saddam.

Read only

0 Likes
2,438

Hi kazmi,

I have tried the program but i am unable to show the % vale in the colored portion of the PIE chart.

Read only

Former Member
0 Likes
2,438

Hi,

Refer above threads.

Regards,

Jaydeep

Read only

0 Likes
2,438

Hi jaydeep,

I have tried all the threads you have posted above.....i was able to draw the pie chart but unable to represent the % value in the diagram. please help me in how to achieve it.

Read only

0 Likes
2,438

Hi,

You can label your chart area as follow, will this do ?

Regards,

Jaydeep

Read only

0 Likes
2,438

hi jaideep

That will do but how to get this

Read only

0 Likes
2,438

Hi,

you can use fm ' GRAPH_MATRIX_2D' .

here is sample code.

DATA: BEGIN OF data  OCCURS 1,
         text(36),
         feld1 TYPE p,
       END OF data,
       BEGIN OF opts OCCURS 1,
         c(80) TYPE c,
       END OF opts,
       BEGIN OF tyear OCCURS 1,
         c(20) TYPE c,
       END OF   tyear.

opts-c = 'P2TYPE = PI'.
APPEND opts.

data-text = 'X 10'.
data-feld1 = '10'.
APPEND data.

data-text = 'Y 20'.
data-feld1 = '20'.
APPEND data.


CALL FUNCTION 'GRAPH_MATRIX_2D'
   TABLES
     data        = data
     opts        = opts
     tcol        = tyear
   EXCEPTIONS
     col_invalid = 1
     opt_invalid = 2
     OTHERS      = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.



Or you can take reference of GRBUSG_1 .

Read only

0 Likes
2,438

Hi jaideep,

Thanks for your code... it will solve one of my two qureis mentioned above...

please let me know if there is any way to place this image in the Adobe forms....

Read only

0 Likes
2,438

Dear bhargava dns,


I'm sorry, but I might not be able to help you with this because my system is not config with adobe service.


Regards,

Jaydeep

Read only

Former Member
2,438

hi bhargava,

inpired by jaydeep patel.

I have got the output as per your requirement.

please check blow code.

REPORT  ZR_PIE_CHART2.
DATA: BEGIN OF data  OCCURS 1,
          text(36),
          feld1 TYPE p,
          perc TYPE i,
        END OF data,
        BEGIN OF opts OCCURS 1,
          c(80) TYPE c,
        END OF opts,
        BEGIN OF tyear OCCURS 1,
          c(20) TYPE c,
        END OF   tyear.

  opts-c = 'P2TYPE = PI'.
APPEND opts.

data-text = 'X 10'.
data-feld1 = '10'.
APPEND data.

data-text = 'Y 20'.
data-feld1 = '20'.
APPEND data.

data total type i.

data perc1(20) type c.

loop at data.
   total = total + data-feld1.
ENDLOOP.

loop at data.
   data-perc = ( data-feld1 / 30 ) * 100.
   perc1 = data-perc.
   CONCATENATE perc1 '%' into data-text.
  
   modify data.
ENDLOOP.




CALL FUNCTION 'GRAPH_MATRIX_2D'
    TABLES
      data        = data
      opts        = opts
      tcol        = tyear
    EXCEPTIONS
      col_invalid = 1
      opt_invalid = 2
      OTHERS      = 3.
IF sy-subrc <> 0.
MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
          WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
ENDIF.