Skip to Content
0
Former Member
Oct 04, 2011 at 03:09 PM

Chart Pie with chart designer --> Set color

213 Views

Hello,

I created xml customizing which i use to create a chart pie.

The chart pie is created, but the color settings are ignored.

I do not know how to set the customizing ID so that the pie gets the color.

Do I have to create Points? I tried to find example coding but in program GRAPHICS_IGS_CE_TEST there is only coding for a column chart.

Any idea or example coding? This is my first chart and i am not that familiar with it. I also have not fully understood the relationship between the XML customizing and the Data customizing ... and how I have to create the Data customizing. I used the above mentioned program.

Thank you!!

Here is the coding I created so far:

FORM create_data_pie USING p_ixml_doc TYPE REF TO if_ixml_document.

  • Chart type = Pie, 4 Categories, 1 Series

DATA: l_simplechartdata TYPE REF TO if_ixml_element,

l_categories TYPE REF TO if_ixml_element,

l_series TYPE REF TO if_ixml_element,

l_points TYPE REF TO if_ixml_element,

l_element TYPE REF TO if_ixml_element,

l_encoding TYPE REF TO if_ixml_encoding.

DATA: lv_value TYPE string.

p_ixml_doc = g_ixml->create_document( ).

l_encoding = g_ixml->create_encoding(byte_order = if_ixml_encoding=>co_little_endian

character_set = 'utf-8' ).

p_ixml_doc->set_encoding( l_encoding ).

l_simplechartdata = p_ixml_doc->create_simple_element(

name = 'SimpleChartData' parent = p_ixml_doc ).

l_series = p_ixml_doc->create_simple_element(

name = 'Series' parent = l_simplechartdata ).

  • Piece 1

l_element = p_ixml_doc->create_simple_element(

name = 'S' parent = l_series ).

lv_value = gs_interface_data-fld41.

l_element->if_ixml_node~set_value( lv_value ).

  • Piece 2

l_element = p_ixml_doc->create_simple_element(

name = 'S' parent = l_series ).

lv_value = gs_interface_data-fld73.

l_element->if_ixml_node~set_value( lv_value ).

  • Piece 3

l_element = p_ixml_doc->create_simple_element(

name = 'S' parent = l_series ).

lv_value = gs_interface_data-fld95.

l_element->if_ixml_node~set_value( lv_value ).

  • Piece 4

l_element = p_ixml_doc->create_simple_element(

name = 'S' parent = l_series ).

lv_value = gs_interface_data-fl110.

l_element->if_ixml_node~set_value( lv_value ).

ENDFORM.

Edited by: Viktoria P. on Oct 4, 2011 5:10 PM