cancel
Showing results for 
Search instead for 
Did you mean: 

Graphs in Abap Webdynpro

Former Member
0 Kudos

Hi

All

I have one requirement that i have to plott two curves in one GRAPH in ABAP WEBDYNPRO.

One curve shows standard baby growth in months on X-axis and height on Y-axis.On the same graph

i have to show particular baby growth on the same X-axis and height on Y-axis in another curve.

Please help me regarding this.

Thanks and regards

Venkateswar

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi

All

Actually i get one baby from selection-screen.Based on that selection screen baby i have to plot graph.

In that i have to plot two curves in one GRAPH .

One curve shows standard baby growth in months on X-axis and height on Y-axis.On the same graph

i have to show particular baby growth on the same X-axis and height on Y-axis in another curve.

Please help me regarding this.If any sample code is there please forward me .

Thanks and regards

Venkateswar

Former Member
0 Kudos

You want to show Particular baby growth and standard baby growth on the same graph am i right?

I have a simple question for you.do you know how many babies are there during the design time?

if you dont know how many are there during the design time then you have to create the Serieses dynamically.

This is the code to create dynamic graph.

method wddomodifyview .
data:lr_graph type ref to cl_wd_business_graphics,
     lr_cat type ref to cl_wd_category,
     lr_series type ref to cl_wd_simple_series,
     lr_container type ref to  cl_wd_uielement_container,
     lr_flow type ref to cl_wd_flow_data.

     lr_container ?= view->get_element( 'ROOTUIELEMENTCONTAINER' ).




   lr_graph = cl_wd_business_graphics=>new_business_graphics(
*             BACKGROUND_COLOR     = BACKGROUND_COLOR
*             BIND_CATEGORY_SOURCE = BIND_CATEGORY_SOURCE
*             BIND_ENABLED         = BIND_ENABLED
              bind_series_source   = 'SERIES'
*             BIND_TOOLTIP         = BIND_TOOLTIP
*             BIND_VISIBLE         = BIND_VISIBLE
              chart_type           =
cl_wd_business_graphics=>e_chart_type-columns
              customizing          = 'chart1.xml'
*             DIMENSION            = E_DIMENSION-TWO
*             ENABLED              = ABAP_TRUE
*             FONT_FAMILY          = FONT_FAMILY
              height               = 300
              id                   = 'GRAPH2'
*             IGS_URL              = IGS_URL
*             IMAGE_SOURCE         = IMAGE_SOURCE
*             MAP_SOURCE           = MAP_SOURCE
*             ON_ACTION            = ON_ACTION
*             TOOLTIP              = TOOLTIP
*             TRANSPARENT_COLOR    = TRANSPARENT_COLOR
*             VIEW                 = VIEW
*             VISIBLE              = E_VISIBLE-VISIBLE
*             WIDTH                = 300
                ).

 lr_cat  =      cl_wd_category=>new_category(
                   bind_description  = 'SERIES.COMP1.DESCRIPTION'
*                   BIND_EVENT_ID    = BIND_EVENT_ID
*                   BIND_TOOLTIP     = BIND_TOOLTIP
*                   EVENT_ID         = EVENT_ID
                    id               = 'CAT1'
*                   TOOLTIP          = TOOLTIP
*                   VIEW             = VIEW
                      ).


 lr_graph->set_category( the_category = lr_cat  ).

   lr_series =    cl_wd_simple_series=>new_simple_series(
                       bind_value     = 'SERIES.COMP1.COMPANY1'
*                      CUSTOMIZING_ID = CUSTOMIZING_ID
*                      EVENT_ID       = EVENT_ID
                       id             = 'SERIES1'
*                      LABEL          = LABEL
*                      TOOLTIP        = TOOLTIP
*                      VIEW           = VIEW
                         ).

       lr_graph->add_series(
*           INDEX      = INDEX
           the_series = lr_series
              ).

 lr_flow = cl_wd_flow_data=>new_flow_data( element = lr_graph
).


 lr_container->add_child( lr_graph ) .

endmethod.


To customize the chart 
1. Create a chart through Chart desiner and save as XML file.
2. Import this XML into your Web Dynpro component through MIME.

also check this link to know how to create gragh

https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/ca932ebc-0901-0010-68a0-b4dd81a4...

Thanks

Suman

Former Member
0 Kudos

Hi,

We can go for Webdynpro ABAP or BSP for these graphs.

Go to SE80-> Webdynpro Interface-> create a New one Or

Check out the Standard example WDR_TEST_UI_ELEMENTS in SE80 tcode.

If you are using any table for this table or If you want to use the BAPI then make a service call for this BAPI.

To have a graph we use the Business Graphic UI element, Where category node is given as the X axis and Series is given as Y-Axis.

Check out his link -

http://help.sap.com/saphelp_nw70/helpdata/EN/42/e61cd068dc3ee4e10000000a1553f7/frameset.htm

Regards

Lekha