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: 

Columns graph and lines graph in the same chart

Kartik2
Contributor
0 Kudos

Dear All,

I want have a requirement to display the required capacity as a columns graph and available capacity as a lines graph. Both the graphs have different data and should appear on the same chart.

Which Class or Function Module shall i use to achieve this ??

Thanks and Regards,

kartik

1 ACCEPTED SOLUTION

former_member198275
Active Contributor
0 Kudos

Check FM GRAPH_MATRIX_2D and

Program GRAPHICS_GUI_CE_DEMO for the same

8 REPLIES 8

former_member198275
Active Contributor
0 Kudos

Check FM GRAPH_MATRIX_2D and

Program GRAPHICS_GUI_CE_DEMO for the same

0 Kudos

Dear Mr. Kaushik Datta,

Thank you for your quick reply. But I want my chart to be in a custom container so i am not using the Function Module suggested by you. In using the class CL_GUI_CHART_ENGINE. For multiple data series we can show all the data series as colums or Lines, but my requirement is to show one series as columns and the other series as Lines overlapping on the columns.

How can i achieve it ??

Regards,

kartik

0 Kudos

Hi ,

Somewhat I have understood your requirement. Report GRAPHICS_GUI_CE_DEMO is also using a custom contain and columns and row are populated by using "if_ixml_node~set_value".. check if you can use these logic for the same.

0 Kudos

Hi,

I have gone through the Standard demo program GRAPHICS_GUI_CE_DEMO. But i did not find how to assign different chart types to the charts displayed in a single container.

Thanks and regards,

kartik

0 Kudos

Dear All,

Achieved this using Class CL_GUI_CHART_ENGINE. There is a provision to add multiple series, and we have to name each and every series, i have named first series as 'Series1' and second series which is to be displayed as line as 'Series2'. Now the following is the customizing that is to be used in the customzing xml that is being set to instance of Cl_gui_chart_engine.

<Series>

      ...

</Series>

<Series id="Series2">

      <ChartType>Lines</ChartType>

</Series>

The follwing is the chart obtained -

Thanks and regards,

kartik

0 Kudos

HI Karthik,

This is Mahesh E C .

I have a same requirement as you explained above. I am preparing an Inventory Graph for one of my clients. Here I have a requirement to display the graph with respect to the Target and Actual. Currently I am using CHART ENGINE  and TRANSFORMATIONS to achieve the above.

I have 5 data series and I am using the Chart Type "StackedColumns", in which the Planned data should be displayed as a line . I tried using the method you have mentioned above .Like in the Customizing XML I have written the below tag. but it doesn't working. It would be very helpful if you could  help me on this?.

<Series id="Series5">

           <ChartType>Lines</ChartType>

</Series>

Whole code in Customizing XML.

  CALL TRANSFORMATION zce_customizing
  SOURCE  title       = 'TITLE'
  category_axis_title = 'category_axis_title'
  value_axis_title    = 'value_axis_title'
  colorpalette        = 'Streamline'
  chart_type1         = 'StackedColumns'
  RESULT XML customizing_xml.

 

<?sap.transform simple?>

<tt:transform xmlns:tt="http://www.sap.com/transformation-templates" xmlns:ddic="http://www.sap.com/abapxml/types/dictionary" xmlns:def="http://www.sap.com/abapxml/types/defined">

<tt:root name="CHART_TYPE1" type="?"/>

<tt:root name="TITLE"/>

<tt:root name="CATEGORY_AXIS_TITLE"/>

<tt:root name="VALUE_AXIS_TITLE"/>

<tt:root name="COLOR_1"/>

<tt:root name="COLOR_2"/>

<tt:template>

<SAPChartCustomizing version="2.1">

<GlobalSettings>

<Dimension>three</Dimension>

<ColorPalette>

<tt:text>Tradeshow</tt:text>

</ColorPalette>

<Defaults>

<ChartType>

<tt:value ref="CHART_TYPE1"/>

</ChartType>

</Defaults>

<Series id="Series5">

<ChartType>Lines</ChartType>

</Series>

</GlobalSettings>

<Elements>

<ChartAxis>

<ChartElements/>

<Title>

<Caption>

<tt:value ref="TITLE"/>

</Caption>

<Text>

<Size>14</Size>

</Text>

</Title>

<ValueAxis id="value_axis_title">

<Title>

<Caption>

<tt:value ref="VALUE_AXIS_TITLE"/>

</Caption>

</Title>

</ValueAxis>

</ChartAxis>

</Elements>

</SAPChartCustomizing>

</tt:template>

</tt:transform>

Thanks in Advance.

Mahesh E C

0 Kudos

Hi Karthik,

I have got the same requirement ( Column + Line in a single Chart ), I have added series id in the chart customizing as mentioned by you, but i am unable to get the required output.

I am getting only columns. 'Lines' chart type was not respected for that particular series.

Do i have to add any more to get it done?

Thanks

Santosh

0 Kudos

Hey Karthik,

I have resolved my problem on my own. I made use of ChartDesigner.

Also , I have created a detailed document about chart engine usage & trouble shooting. Hope it will be useful for those,who face problems in using SAP GUI CHART ENGINE.

http://scn.sap.com/docs/DOC-41635

Thanks

Santosh.