cancel
Showing results for 
Search instead for 
Did you mean: 

Interact with PIE Chart in iphone

Former Member
0 Kudos

Dear all,

I've got the request to implement MII screen delivering some data through PIE Charts. This should be deliver through iphone. The request is to have to capability to interact with the applet (or the legend), to drill down to the data behing the chart, and providing later an igrid with more details about the summary displayed in the chart.

As far as i know the iphone doesn't support applets. And if i display the chart as image through a servlet, how the user can drill down and interact?

what could be the approach then? What are your recommendations?

I'm using XMII 11.5.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Dear all,

The problem is solved. There was missing the parsing in the write format

data = jQuery.parseJSON(capa);

After that the PIEs are displayed.

Paul, anyway i will be interested to see your examples, but i have tried to access with the user and password provided but the login is not working. Could you confirm them?

Former Member
0 Kudos

Hi Jose Luis,

For whatever reason the password was locked. Please try again, at your convenience.

Answers (9)

Answers (9)

Former Member
0 Kudos

Hi again Jens,

Posted

Former Member
0 Kudos

I'll keep the demo user active for 48h .. open the links in iPhone and test please.

http://rts.entuit.com/XMII/CM/SMS/iPhonePieDay.irpt?j_user=demo&j_password=Pass01

http://rts.entuit.com/XMII/CM/SMS/iPhonePieWeek.irpt?j_user=demo&j_password=Pass01

The only part you cannot see when you look at the source-code in these examples is the code for the servlet ..

The 1st value on the charts should redirect you to Google, second to Yahoo, third to Microsoft ..

paul.

Former Member
0 Kudos

Jens,

The system doesn't allow me to paste the code. Everytime i try to paste, i'm getting a post error.

How can i forward it to you?? Mail?

Former Member
0 Kudos

Hi Jens,

Yes, it is included. Basically i took your example and just modified the URL. I will try to post the whole code but sometime i have problems with the forum (I'm getting method not implemented when i try to post)

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<html><head>

Former Member
0 Kudos

Hi Jose,

You can post the code into the wordpress blog above, and i can collect it from there.

BR

Jens

Former Member
0 Kudos

Hi Musarrat,

I have implemented the data=[capa] but with the same result, no pie chart.

Jen,

I have implemented your examples, and, as a result i just see a empty rectangle in the screen.

The results of the URL after applying the XSLT is:

[ {"label":" Open","data":"121"} , {"label":" Overdue","data":"188"} ]

that is the data contained in my database.

I have added to alerts in the function but they don't appear. I'm using XMII 11.5 and i haven't found the role mentioned.

Any more ideas??

Former Member
0 Kudos

Hi Jose,

Are you doing the following in your javascript:


  for(var i = 0, len = series.length; i<len; i++) {
   data.push({"label":series<i>.label,"data":Number(series<i>.data) });
  }

The Flot library requires the numbers in your dataset to be numbers and not strings.

Otherwise please provide the html/javascript code to me, and i can have a look at it.

BR

Jens

Former Member
0 Kudos

Hello Musarrat,

One question. You mentioned in your answer "convert the output string to an object".

What i should do that?

I think may be this is the problem.

Thanks

Former Member
0 Kudos

Hi Jose,

I have made an example, unfortunally there is some problems posting on this forum, so i have made the example available at the following link:

http://jenskyed.wordpress.com/2011/05/18/using-sap-mii-with-flot-pie-chart-library/

BR

Jens

Former Member
0 Kudos
data=[capa];

Edited by: Musarrat Husain on May 18, 2011 2:53 PM

Former Member
0 Kudos

Dear all,

Thank you for the feedback. I will take a look to the examples. I'm not entirely sure if the issue is related to the data format.

This is part of my code

 $(function () { 

 	var capa= [];

 	capa =$("#capas").contents().find("body").text();

 	data=capa;

 	//data =[ { label : " Open ", data : 121 } , { label : " Overdue ", data : 188 } ];

Basically the data comes from an iframe that contains a servlet that gets the data from the database. Then i formated the data through the XSLT. When i assign the hardcoded data that you seea as comment, the pie chart is displayed. When i assign the data that comes from the iframe it doesnt't work. The data i see in the iframe looks exactly the same as the hardcoded string. If anyone sees the problem will be great.

I will play with the examples provided.

Thanks

Former Member
0 Kudos

Dear all,

I'm still fighting with that. I have a servlet that is gathering all the data that i need to pass to the pie chart. But i don't know how to pass it to the data variables.

I have been looking to the flot examples but without success. I have include the servlet in an iframe. But i'm not able to send the data to the plot function. Any help is appreciated.

Former Member
0 Kudos

You can also use RaphaelJS. They have examples (see below). Just rightclick in the demo window, and view the JS code. Legend, links on every item .. etc included.

Practically you will generate tabular data with MII servlets, javascript will load the data from those tables and will display the pie

http://raphaeljs.com/pie.html

http://raphaeljs.com/growing-pie.html

Former Member
0 Kudos

Hello Jose,

I played around a little bit and found that data passed to plot funtion should be in json format.

Is there any other format that is available there? The format that I used was something like this

{
    "label": "Europe (EU27)",
    "data": [[1999, 3.0], [2000, 3.9], [2001, 2.0], [2002, 1.2], [2003, 1.3], [2004, 2.5], [2005, 2.0], [2006, 3.1], [2007, 2.9], [2008, 0.9]]
}

What I did to achieve it was something like this(although there would be better ways to do it):

Construct the json string in BLS and assign it to "output" variable(string format).

Call the BLS as webservice using jquery.

parse the data returned from jquery call to "output" level.

Convert the "output" string to an object.

pass the data to the plot fuction.

This was the example that I was able to inherit using MII data,

http://people.iola.dk/olau/flot/examples/ajax.html

I feel getting a pie chart using the same approach is quite possible.

Regrds,

Musarrat

Edited by: Musarrat Husain on May 18, 2011 9:07 AM

Former Member
0 Kudos

Hi Jens,

thank you for the information. I don't understand very well how it will work and how can i link that with the data provided by MII. MII will extract the data from a shop floor system and i need to display it with the PIe chart.

Do i have to download the library and include it in our html pages? Is the library free?

I would thank if you could guide me a litle bit more.

Thanks

Former Member
0 Kudos

Start here:

[http://code.google.com/p/flot/|http://code.google.com/p/flot/]

Former Member
0 Kudos

was just wandering on the forum... Christian and Jens Thanks for the share. I would love to explore it a bit.

Regards,

Musarrat

Former Member
0 Kudos

Maybe you should try to look at the following html5 chart library, i think it has the capabilities you need.

http://people.iola.dk/olau/flot/examples/pie.html

BR

Jens