cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in Stacked Bar Chart SAP MII 12.2.6

Former Member

Hi All,

     I am using SAP MII 12.2.6(Build 54).

     I create one chart with follwing details:

Query Output:

if i mapp this query to Bar Chart means i got output like below:

If i use stacked Bar Chart Means i got output like,

 

In this chart, I am really get confused at what basis it got stacked.

In query result, the reason code is not repeated to other machine.

The query gives unique distinct values.

As per query result the chart shows wrong.

the configuration is given by,

I expect the same result as bar chart. When query gives result as reason code repeated for 2 or more machine means then only the chart gets stacked.

Kindly Help me this issue.

Regards,

Santhosh K

Accepted Solutions (0)

Answers (4)

Answers (4)

swaroop_anasane
Active Contributor
0 Kudos

Hi Santhosh,

Remove MachineName from Label columns and keep it in value.

You should be able to see different reasurce codes and machine name mounted on top of it.

Hope this helps.

Regards,

Swaroop

Former Member
0 Kudos

Hi All,

     Thanks for tour response.

     If i include reasoncode in label column means i got output like,

Regards,

Santhosh K

former_member204240
Active Participant
0 Kudos

Sathosh, what is your exact requirement? how you need your graph?

If possible can you paste a sample chart for data you have given.

Former Member
0 Kudos

hi padma,

     My requrement is,

          x-axis- Reason code

          y-axis- Downtime

          stacked by Machine name.

For my current query result, the chart not get to be stacked.

if reason code is repeated to 2 or more machines means then its gets stacked.

the color differents are based on machine Name. Means for this i have four machines.

Regards,

Santhosh K

Former Member
0 Kudos

Sample Chart:

In this i am using reason code instead of reason description in x-axis.

Former Member
0 Kudos

Dear Santhosh,

I really doubt if you will be able to get a correct Stacked Bar chart unless you have your XML structured properly as required for a stacked bar chart.

I did try several options mentioned in this thread with the output you have pasted above, but was not able to get a proper chart.

Warm Regards,

Anuj

former_member204240
Active Participant
0 Kudos

Let me understand your graph, in above sample for each reason desc or reason code, there is set of downtime values for machines(suppose if 5 machines are there, in that there can be downtime only for 3 like that which varies). correct know?

You have following data.

1. You will have what is no of machines available.

2. Set of reason code.

3. and Downtime values (if there) for that reason and for the machine.

If this is your above requirement, Then you need to construct the output like below

Reason code340315323317
5931477000
14430138000
1447960000
55577708880

So give 0 as downtime value to the machine which has no downtime for that reason.

If you check last row see 555 is reason which has downtime for 2 machine so it will stack.

Plot Reasoncode as X axis and map all the other columns in value column.

swaroop_anasane
Active Contributor
0 Kudos

Hi Santhosh,

Here, you have kept the label column as machine name and hence it is showing stacked bars for distinct dates with a set of machine name each. If you see the legends in the chart, it says that bars are for 340-->315-->323-->317 from bottom to top and it shows values that lie on a particular day(grouped by date).

You want to see bars stacked only when there is multiple entry for one "resourcecode" and that too when lies on a particular day, you can give resource code as label column.

Hope this helps.

Regards,

Swaroop

Former Member
0 Kudos

Hi Santhosh,

The XML structure for a Bar Chart and a Stacked Bar chart is different.

The bar chart you have plotted as depicted in the picture above is Downtimes again each reason code, but in order to get the stacked bar chart, your XML needs to be structured accordingly.

Few things are a bit unclear as per your explanation for a stacked bar chart. Can you please elaborate how you want to plot your stacked bar chart, may be after that I can help you out with the XML structure for the same.

Attaching a basic stacked bar chart for a XML output for your reference.

Warm Regards,

Anuj

Message was edited by: Anuj Suryawanshi

matthias_hollstein
Participant
0 Kudos

Hello Anuj

what are your setting for your example?

I tried it myself, but I do not get such a stacked bar chart with similar data.

Do you have some examples to clarify what the difference in the XML structure of a Bar Chart and a Stacked Bar chart is?

thank you

kind regards

Matthias

Former Member
0 Kudos

Hi Matthias,

Please refer the screenshots below:

For 'Data Mapping'

Rest everything is blank/unchecked.

For 'X-Axis'

This is for a basic Stacked bar chart as shown in my post above. You can work on the Labels and all.

To explain the difference between a Bar Chart and a Stacked Bar chart, I would take the example of these two charts from the posts above.

Bar Chart pasted by Santhosh caters two dimensions only i.e Reason Code and corresponding downtimes, so an XML with these two columns should be sufficient to plot a Bar Chart, whereas a Stacked Bar Chart caters multiple dimensions (Machine, DownTime1,DownTime2 and DownTime3 in the chart I have pasted above) and hence the XML should have these many columns to plot a Stacked Bar Chart.

To add one more example, if you want to plot a chart for City Vs Population, it will be a Bar Chart but to plot a chart for City Vs Men, Women and Children in those cities, it has to be a Stacked Bar chart because it can cater categorization of population as Men, Women and Children in different cities.

Hope these examples explain the difference between the two charts 🙂

Warm Regards,

Anuj

matthias_hollstein
Participant
0 Kudos

Hello Anuj

many many thanks for your reply and this infos.

The difference between the two bar charts is clear for me now.

I make the same settings on my example chart, but I've got no output I want (like yours).

my Xacute Output I use:

the generated Stacked Bar Chart (Image)

my data settings:

the settings for X-Axis are exactly the same you documented above

so, do you have another idea, what the problem seems to be

kind regards

Matthias

Former Member
0 Kudos

Hi Matthias,

I plotted a stacked bar chart for your XML and it works absolutely fine with the settings I have mentioned in my earlier post.

One point to remember here, instead of a 0 at different places, leave it blank to avoid a thin line in between stacked bars.

Few questions,

What is the MII version you are using?

What is the JRE version?

And request you to paste the XML form of the output you have pasted above.

Thanks & Regards,

Anuj

matthias_hollstein
Participant
0 Kudos

Hi Anuj

many thanks for your help!

here are the infos you wanted to know:

MII version: 12.2.5 Build(72)

JRE version: I've tried severall (6u43, 6u45, 6u07 and 5u10)

IE Version on VM with XP is: 8

IE Version on Win7 host is: 9

the XML output with zeros is:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>

<Rowsets CachedTime="" DateCreated="2013-10-25T09:15:14" EndDate="2013-10-25T09:15:14" StartDate="2013-10-25T08:15:14" Version="12.2.5 Build(72)">

  <Rowset>

    <Columns>

      <Column Description="MachineName" MaxRange="1" MinRange="0" Name="MachineName" SQLDataType="4" SourceColumn="MachineName"/>

      <Column Description="RC_593" MaxRange="1" MinRange="0" Name="RC_593" SQLDataType="4" SourceColumn="RC_593"/>

      <Column Description="RC_1443" MaxRange="1" MinRange="0" Name="RC_1443" SQLDataType="4" SourceColumn="RC_1443"/>

      <Column Description="RC_1447" MaxRange="1" MinRange="0" Name="RC_1447" SQLDataType="4" SourceColumn="RC_1447"/>

      <Column Description="RC_326" MaxRange="1" MinRange="0" Name="RC_326" SQLDataType="4" SourceColumn="RC_326"/>

      <Column Description="RC_555" MaxRange="1" MinRange="0" Name="RC_555" SQLDataType="4" SourceColumn="RC_555"/>

    </Columns>

    <Row>

      <MachineName>315</MachineName>

      <RC_593>0</RC_593>

      <RC_1443>1380</RC_1443>

      <RC_1447>0</RC_1447>

      <RC_326>0</RC_326>

      <RC_555>0</RC_555>

    </Row>

    <Row>

      <MachineName>317</MachineName>

      <RC_593>0</RC_593>

      <RC_1443>0</RC_1443>

      <RC_1447>0</RC_1447>

      <RC_326>0</RC_326>

      <RC_555>777</RC_555>

    </Row>

    <Row>

      <MachineName>323</MachineName>

      <RC_593>0</RC_593>

      <RC_1443>0</RC_1443>

      <RC_1447>960</RC_1447>

      <RC_326>120</RC_326>

      <RC_555>0</RC_555>

    </Row>

    <Row>

      <MachineName>340</MachineName>

      <RC_593>1477</RC_593>

      <RC_1443>0</RC_1443>

      <RC_1447>0</RC_1447>

      <RC_326>680</RC_326>

      <RC_555>0</RC_555>

    </Row>

  </Rowset>

</Rowsets>

now I've tried to delete the zeros.

after transformating the output looks like:

<?xml version="1.0" encoding="utf-8"?>

<Rowsets CachedTime="" DateCreated="2013-10-25T09:15:14" EndDate="2013-10-25T09:15:14" StartDate="2013-10-25T08:15:14" Version="12.2.5 Build(72)">

  <Rowset>

    <Columns>

      <Column Description="MachineName" MaxRange="1" MinRange="0" Name="MachineName" SQLDataType="4" SourceColumn="MachineName" />

      <Column Description="RC_593" MaxRange="1" MinRange="0" Name="RC_593" SQLDataType="4" SourceColumn="RC_593" />

      <Column Description="RC_1443" MaxRange="1" MinRange="0" Name="RC_1443" SQLDataType="4" SourceColumn="RC_1443" />

      <Column Description="RC_1447" MaxRange="1" MinRange="0" Name="RC_1447" SQLDataType="4" SourceColumn="RC_1447" />

      <Column Description="RC_326" MaxRange="1" MinRange="0" Name="RC_326" SQLDataType="4" SourceColumn="RC_326" />

      <Column Description="RC_555" MaxRange="1" MinRange="0" Name="RC_555" SQLDataType="4" SourceColumn="RC_555" />

    </Columns>

    <Row>

      <MachineName>315</MachineName>

      <RC_593 />

      <RC_1443>1380</RC_1443>

      <RC_1447 />

      <RC_326 />

      <RC_555 />

    </Row>

    <Row>

      <MachineName>317</MachineName>

      <RC_593 />

      <RC_1443 />

      <RC_1447 />

      <RC_326 />

      <RC_555>777</RC_555>

    </Row>

    <Row>

      <MachineName>323</MachineName>

      <RC_593 />

      <RC_1443 />

      <RC_1447>960</RC_1447>

      <RC_326>120</RC_326>

      <RC_555 />

    </Row>

    <Row>

      <MachineName>340</MachineName>

      <RC_593>1477</RC_593>

      <RC_1443 />

      <RC_1447 />

      <RC_326>680</RC_326>

      <RC_555 />

    </Row>

  </Rowset>

</Rowsets>

the Xacute Output now is:

and my Stacked Bar Chart (generated image)

I can not use the applet in the browser

There is an error message :
Applet BarCharTest notinited

the java console is giving this back:

java.lang.ClassNotFoundException: iChart

at sun.applet.AppletClassLoader.findClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadClass(Unknown Source)

at java.lang.ClassLoader.loadClass(Unknown Source)

at sun.applet.AppletClassLoader.loadCode(Unknown Source)

at sun.applet.AppletPanel.createApplet(Unknown Source)

at sun.plugin.AppletViewer.createApplet(Unknown Source)

at sun.applet.AppletPanel.runLoader(Unknown Source)

at sun.applet.AppletPanel.run(Unknown Source)

at java.lang.Thread.run(Unknown Source)

so I can only generate images to test my applet

but this may be also creapy

I've try some research on the java console message.

kind regards

Matthias

Former Member
0 Kudos

Hi Matthias,

Everything looks absolutely OK. Wonder why the chart is not plotted properly.

Yes, getting the image might be creepy which is usually not, but no harm in giving a try by loading this chart applet in your browser.

Are you calling any javascript function on 'onload' event of HTML which uses this particular applet?

Warm Regards,

Anuj

matthias_hollstein
Participant
0 Kudos

Hi ANuj

thank you again for answering!

I do not found helpful answers into my error message issue, so I've tried another MII (good that we have some running versions in our office)

now I'm using Version 12.1.7 Build(47)

And with this version I have an applet that is working in the browser

but

it is the same like the generated image!

so I have do to more research on the data structure and/or the settings, I think.

I have no special html/javascript code - only the standard generated ones.

this it is:

<HTML> 

<HEAD> 

<TITLE>Your Title Here</TITLE> 

<SCRIPT language="JavaScript"> 

</SCRIPT> 

</HEAD> 

<BODY> 

<APPLET NAME="Untitled" CODEBASE="/XMII/Classes" CODE="iChart" ARCHIVE="illum8.zip" WIDTH="640" HEIGHT="400" TABINDEX=1 MAYSCRIPT> 

<PARAM NAME="QueryTemplate" VALUE="TH_Sandbox_MH/BarChartTest/StackedBarChartXac"> 

<PARAM NAME="DisplayTemplate" VALUE="TH_Sandbox_MH/BarChartTest/StackedBarChart"> 

</BODY> 

</HTML>

but is there a "hidden" feature I have to enable or so?

kind regards

Matthias

matthias_hollstein
Participant
0 Kudos

one more point

if I changed the zeros to 10 I have another strange output:

this is also the output on the 12.2 version picture

maybe it will clearify something

kind regards

Matthias

Former Member
0 Kudos

Hi Matthias,

Please refer the screen shot below for 'Server Scaling'

In a default template 'Use Global Server Scaling' is checked. Make changes as per the above screenshot along with rest of the template configuration as mentioned in my earlier posts.

I hope it should work as expected now 🙂

Warm Regards,

Anuj

matthias_hollstein
Participant
0 Kudos

Hello Anuj

tahnk you for your response

I've tried your settings suggested, but there is a new strange behaviour:

with 10 instead of 0 it looks more better with the new settings:

so, now, if swtiched back without transformation, so my data will contained 0 again.

and now it looks very good:

I think you solved this issue successful.

Many thanks!

kind regards

Matthias

Former Member
0 Kudos

Hi Matthias,

Good to hear that 🙂

Cheers,

Anuj