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: 

Problem with defining colors in columns using chart generator

Former Member
0 Kudos

Dear All,

I am using the chart designer to generate the XML template for a columns chart. Then I am using the xml generated in my ABAP program. Every thing like background color, title etc are coming as per the requirement and defined in the XML template, except the color of the columns. The color of the columns are coming as the default color and not the ones I set in my designer. I am sure I am missing something, but not sure what

Here is my sample code for the creation of the series

     f_series1 = f_ixml_data_doc->create_simple_element(

               name = 'Series'

               parent = f_chartdata ).

     f_series1->set_attribute( name = 'customizing'

                              value = 'Series1' ).

     f_series1->set_attribute( name = 'label' value = 'Open' ).

     f_series2 = f_ixml_data_doc->create_simple_element(

           name = 'Series'

           parent = f_chartdata ).

     f_series2->set_attribute( name = 'customizing'

                              value = 'Series2' ).

     f_series2->set_attribute( name = 'label' value = 'Closed' ).

     f_series3 = f_ixml_data_doc->create_simple_element(

           name = 'Series'

           parent = f_chartdata ).

     f_series3->set_attribute( name = 'customizing'

                              value = 'Series3' ).

     f_series3->set_attribute( name = 'label' value = 'Backlog' ).

I am not sure what I am missing

Thanks in advance for your help

Best Regards

Anirban

1 ACCEPTED SOLUTION

pavanm592
Contributor
0 Kudos

Hi,

After the f_series1 please add the below code

data : l_element  type ref to  if_ixml_element.

     l_element = p_ixml_doc->create_simple_element(

                 name = 'Color' parent = f_series1 ).

     l_element->if_ixml_node~set_value( 'RGB(69,193,208)' ).

     l_element = p_ixml_doc->create_simple_element(

                   name = 'BorderColor' parent = f_series1 ).

     l_element->if_ixml_node~set_value( 'RGB(69,193,208)' ).

change acordingly for the next two columns also

If any issues please Revert.

Thanks,

Pavan

4 REPLIES 4

pavanm592
Contributor
0 Kudos

Hi,

After the f_series1 please add the below code

data : l_element  type ref to  if_ixml_element.

     l_element = p_ixml_doc->create_simple_element(

                 name = 'Color' parent = f_series1 ).

     l_element->if_ixml_node~set_value( 'RGB(69,193,208)' ).

     l_element = p_ixml_doc->create_simple_element(

                   name = 'BorderColor' parent = f_series1 ).

     l_element->if_ixml_node~set_value( 'RGB(69,193,208)' ).

change acordingly for the next two columns also

If any issues please Revert.

Thanks,

Pavan

Former Member
0 Kudos

Hello Pavan,

I put the code as you mentioned, but it had no effects on the color of the columns (series). I checked OSS note 0001831400 and applied it, but seems the problem remains. Its really strange!!

Let me know if you know any other tricks

Thanks for your help

Best Regards

Anirban

0 Kudos

Hi Anirban,

if possible give some screen shots of output and complete graph code.

Regards

Pavan

Former Member
0 Kudos

Hello Pavan,

Sorry for disturbing you but I finally found the problem. SAP Chart Designer is giving wrong template value for Plot area which was causing the XML transformation to fail.

Thanks for your help

Best Regards

Anirban