Application Development 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: 

3-D Bar Chart doesn't work in container.

Former Member
0 Kudos

Hello Experts,

I face to a strange problem. I create a bar-chart in 3-D, but somebody see this graphics is 2-D in default.

could you kindly tell how to the customizing setting to set the 3-D as default?

thanks a lot for your help!

best regards,

Tao

1 ACCEPTED SOLUTION

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

My customization:


FORM do_chart_1_cust_1
  CHANGING
    ob_gui_chart_engine TYPE REF TO cl_gui_chart_engine
    ob_ixml             TYPE REF TO if_ixml .

  DATA: ob_ixml_document    TYPE REF TO if_ixml_document ,
        ob_ixml_encoding    TYPE REF TO if_ixml_encoding .

  DATA: ob_sapchartcustomizing  TYPE REF TO if_ixml_element ,
        ob_globalsettings       TYPE REF TO if_ixml_element ,
        ob_defaults             TYPE REF TO if_ixml_element ,
        ob_charttype            TYPE REF TO if_ixml_element ,
        ob_elements             TYPE REF TO if_ixml_element ,
        ob_charttypes           TYPE REF TO if_ixml_element ,
        ob_columns              TYPE REF TO if_ixml_element ,
        ob_values               TYPE REF TO if_ixml_element ,
        ob_series               TYPE REF TO if_ixml_element ,
        ob_element              TYPE REF TO if_ixml_element ."Reused as leaf

  ob_ixml_document = ob_ixml->create_document( ).

  ob_ixml_encoding = ob_ixml->create_encoding(
        byte_order    = if_ixml_encoding=>co_little_endian
        character_set = 'utf-8' ) .

  ob_ixml_document->set_encoding( ob_ixml_encoding ) .

  ob_sapchartcustomizing = ob_ixml_document->create_simple_element(
           name = 'SAPChartCustomizing' parent = ob_ixml_document ) .
  ob_sapchartcustomizing->set_attribute( name = 'version' value = '2.0' ) .

  ob_globalsettings = ob_ixml_document->create_simple_element(
           name = 'GlobalSettings' parent = ob_sapchartcustomizing ) .

  ob_element = ob_ixml_document->create_simple_element(
          name = 'Dimension' parent = ob_globalsettings ) .
  ob_element->if_ixml_node~set_value( 'Three' ) .
* ob_element->if_ixml_node~set_value( 'Two' ) .

  ob_element = ob_ixml_document->create_simple_element(
          name = 'ColorPalette' parent = ob_globalsettings ) .
  ob_element->if_ixml_node~set_value( 'Streamline' ) .

  ob_defaults = ob_ixml_document->create_simple_element(
           name = 'Defaults' parent = ob_globalsettings ) .

  ob_charttype = ob_ixml_document->create_simple_element(
           name = 'ChartType' parent = ob_defaults ) .
* ob_charttype->if_ixml_node~set_value( 'Doughnut' ).
* ob_charttype->if_ixml_node~set_value( 'Pie' ).
* ob_charttype->if_ixml_node~set_value( 'Lines' ).
  ob_charttype->if_ixml_node~set_value( 'Columns' ) .

  ob_elements = ob_ixml_document->create_simple_element(
           name = 'Elements' parent = ob_sapchartcustomizing ) .

  ob_charttypes = ob_ixml_document->create_simple_element(
         name = 'ChartTypes' parent = ob_elements ) .

  ob_columns = ob_ixml_document->create_simple_element(
         name = 'Columns' parent = ob_charttypes ) .

  ob_element = ob_ixml_document->create_simple_element(
          name = 'VaryColorsByPoint' parent = ob_columns ) .
  ob_element->if_ixml_node~set_value( 'true' ) .

  """"
  ob_values = ob_ixml_document->create_simple_element(
           name = 'Values' parent = ob_sapchartcustomizing ) .

  ob_series = ob_ixml_document->create_simple_element(
          name = 'Series' parent = ob_values ) .

  ob_series->set_attribute( name = 'id' value = c_series_01 ) .

  ob_element = ob_ixml_document->create_simple_element(
         name = 'ShowLabel' parent = ob_series ) .
  ob_element->if_ixml_node~set_value( 'true' ) .
  """"

  DATA: g_ixml_sf              TYPE REF TO if_ixml_stream_factory.
  DATA: ob_ixml_stream_factory TYPE REF TO if_ixml_stream_factory.
  DATA: ob_ostream   TYPE REF TO if_ixml_ostream .
  DATA: xstring      TYPE xstring.
  DATA: debug_string TYPE string .

  ob_ixml_stream_factory = ob_ixml->create_stream_factory( ).

  ob_ostream = ob_ixml_stream_factory->create_ostream_cstring( debug_string ).
  ob_ixml_document->render( ostream = ob_ostream ) .

  ob_ostream = ob_ixml_stream_factory->create_ostream_xstring( xstring ).
  ob_ixml_document->render( ostream = ob_ostream ) .

  ob_gui_chart_engine->set_customizing( xdata = xstring ) .

ENDFORM .                    "do_chart_1_cust_1

5 REPLIES 5

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

What are you using ?

SAP have more then one way to create bar chart....

Regards.

0 Kudos

I use class  cl_gui_chart_engine to create columns chart, someone see it in 3-D but someones not. I set the default customizing of this columns chart as 3-D already. I think somewhere to change the 3-D and 2-D parameters in SAP GUI....

rosenberg_eitan
Active Contributor
0 Kudos

Hi,

My customization:


FORM do_chart_1_cust_1
  CHANGING
    ob_gui_chart_engine TYPE REF TO cl_gui_chart_engine
    ob_ixml             TYPE REF TO if_ixml .

  DATA: ob_ixml_document    TYPE REF TO if_ixml_document ,
        ob_ixml_encoding    TYPE REF TO if_ixml_encoding .

  DATA: ob_sapchartcustomizing  TYPE REF TO if_ixml_element ,
        ob_globalsettings       TYPE REF TO if_ixml_element ,
        ob_defaults             TYPE REF TO if_ixml_element ,
        ob_charttype            TYPE REF TO if_ixml_element ,
        ob_elements             TYPE REF TO if_ixml_element ,
        ob_charttypes           TYPE REF TO if_ixml_element ,
        ob_columns              TYPE REF TO if_ixml_element ,
        ob_values               TYPE REF TO if_ixml_element ,
        ob_series               TYPE REF TO if_ixml_element ,
        ob_element              TYPE REF TO if_ixml_element ."Reused as leaf

  ob_ixml_document = ob_ixml->create_document( ).

  ob_ixml_encoding = ob_ixml->create_encoding(
        byte_order    = if_ixml_encoding=>co_little_endian
        character_set = 'utf-8' ) .

  ob_ixml_document->set_encoding( ob_ixml_encoding ) .

  ob_sapchartcustomizing = ob_ixml_document->create_simple_element(
           name = 'SAPChartCustomizing' parent = ob_ixml_document ) .
  ob_sapchartcustomizing->set_attribute( name = 'version' value = '2.0' ) .

  ob_globalsettings = ob_ixml_document->create_simple_element(
           name = 'GlobalSettings' parent = ob_sapchartcustomizing ) .

  ob_element = ob_ixml_document->create_simple_element(
          name = 'Dimension' parent = ob_globalsettings ) .
  ob_element->if_ixml_node~set_value( 'Three' ) .
* ob_element->if_ixml_node~set_value( 'Two' ) .

  ob_element = ob_ixml_document->create_simple_element(
          name = 'ColorPalette' parent = ob_globalsettings ) .
  ob_element->if_ixml_node~set_value( 'Streamline' ) .

  ob_defaults = ob_ixml_document->create_simple_element(
           name = 'Defaults' parent = ob_globalsettings ) .

  ob_charttype = ob_ixml_document->create_simple_element(
           name = 'ChartType' parent = ob_defaults ) .
* ob_charttype->if_ixml_node~set_value( 'Doughnut' ).
* ob_charttype->if_ixml_node~set_value( 'Pie' ).
* ob_charttype->if_ixml_node~set_value( 'Lines' ).
  ob_charttype->if_ixml_node~set_value( 'Columns' ) .

  ob_elements = ob_ixml_document->create_simple_element(
           name = 'Elements' parent = ob_sapchartcustomizing ) .

  ob_charttypes = ob_ixml_document->create_simple_element(
         name = 'ChartTypes' parent = ob_elements ) .

  ob_columns = ob_ixml_document->create_simple_element(
         name = 'Columns' parent = ob_charttypes ) .

  ob_element = ob_ixml_document->create_simple_element(
          name = 'VaryColorsByPoint' parent = ob_columns ) .
  ob_element->if_ixml_node~set_value( 'true' ) .

  """"
  ob_values = ob_ixml_document->create_simple_element(
           name = 'Values' parent = ob_sapchartcustomizing ) .

  ob_series = ob_ixml_document->create_simple_element(
          name = 'Series' parent = ob_values ) .

  ob_series->set_attribute( name = 'id' value = c_series_01 ) .

  ob_element = ob_ixml_document->create_simple_element(
         name = 'ShowLabel' parent = ob_series ) .
  ob_element->if_ixml_node~set_value( 'true' ) .
  """"

  DATA: g_ixml_sf              TYPE REF TO if_ixml_stream_factory.
  DATA: ob_ixml_stream_factory TYPE REF TO if_ixml_stream_factory.
  DATA: ob_ostream   TYPE REF TO if_ixml_ostream .
  DATA: xstring      TYPE xstring.
  DATA: debug_string TYPE string .

  ob_ixml_stream_factory = ob_ixml->create_stream_factory( ).

  ob_ostream = ob_ixml_stream_factory->create_ostream_cstring( debug_string ).
  ob_ixml_document->render( ostream = ob_ostream ) .

  ob_ostream = ob_ixml_stream_factory->create_ostream_xstring( xstring ).
  ob_ixml_document->render( ostream = ob_ostream ) .

  ob_gui_chart_engine->set_customizing( xdata = xstring ) .

ENDFORM .                    "do_chart_1_cust_1

0 Kudos

hello,

These customizing coding had been done in my program before I requested this problem.

The detailed problem is that someone see this columns chart as 3-D but someone not.

0 Kudos

Hi,

I am trying to solve your problem by eliminations....

Is the program design so the user can save his customiztion and use it as default ?

Ask the user to run program GRAPHICS_GUI_CE_DEMO and see what happen ?

Regards.