BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 08-22-2007, 02:05 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 8300
PIN: N/A
Carrier: developer
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default create chart on blackberry

Please Login to Remove!

Hi

how to create chart on blackberry mds studio or blackberry visual studio plug-in ?


thanks
Offline  
Old 08-22-2007, 03:52 PM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2007
Model: 8100
PIN: N/A
Carrier: Rogers
Posts: 140
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

You could do it a couple of ways...

1) You can create an ASP.NET page that would take in values and generate a JPG and return it as a result. So your javascript would look something like:

Form1.PictureBox1.value = "http://myserver/myservice.aspx?value1=2&value2=3";

It will automatically then load in the picture of the graph that you created on the server.

2) Is a little bit of a hack... you can use the Label controls and add white space to the values of the controls to set their lengths. Then set the background color of the labels to be different colors... The code would look like this:

Form1.label1.value = "<some-whitespace>";
Form1.label2.value = "<more-whitespace>";
Form1.label3.value = "<less-whitespace>";

I had to put in the <x-whitespace> because the forum page was not showing what I want..

You would probably have to do some fancy math to make it fit on the screen but it would end up looking like the following:

Last edited by brcewane : 08-22-2007 at 03:54 PM. Reason: Added the whitespace stuff
Offline  
Old 08-22-2007, 11:13 PM   #3 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 8300
PIN: N/A
Carrier: developer
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default thank you brcewane

i need a chart as in this picture:

DietOrganizer BlackBerry - Diet Software Calorie Counter for Weight Loss

have idea ?

thanks
Offline  
Old 08-23-2007, 10:27 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2007
Model: 8100
PIN: N/A
Carrier: Rogers
Posts: 140
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

The only way in the MDS Runtime technology that you would be able to display a chart like that would be my option #1 from my previous post.. basically send all the information to the webservice, have the webservice create the JPG.. save it on the server in a temporary space and then pass the url for the JPG back to the device as a string. Then set the .value of the PictureBox to be the url and it will display your image.

An alternative would be to instead create a ASP/JSP to take in all the parameters like above and display an HTML page with other information in it and open it up with the BlackBerry Browser using the system browse call from the MDS javascript. However this would then bring the user outside of the MDS Runtime application.
Offline  
Old 08-23-2007, 01:02 PM   #5 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 8300
PIN: N/A
Carrier: developer
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default chart

ok.
can you explain how to do it ?

"...basically send all the information to the webservice, have the webservice create the JPG.. save it on the server in a temporary space and then pass the url for the JPG back to the device as a string. Then set the .value of the PictureBox to be the url and it will display your image..."

i don't now how create a webservise ...

Thank you
Offline  
Old 08-23-2007, 01:08 PM   #6 (permalink)
Thumbs Must Hurt
 
Join Date: Aug 2007
Model: 8100
PIN: N/A
Carrier: Rogers
Posts: 140
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

Here is a good site on how to get started with webservices.. they are quite easy to do in Visual Studio Getting Started with Web Services

In visual Studio do a "New -> WebSite -> ASP.NET Web Service" and you are ready to roll. Add some methods in there with a [WebMethod] code attribute like the sample method that is created by the template.

Then add a BlackBerry project to your visual studio solution and add a web reference from your blackberry project ("right click project -> Add web reference") and select your web service you just created.

There are mobile and server examples included with the BlackBerry plugin.. they have a sample browser that is kinda hidden on your Start -> Programs -> Research In Motion -> BlackBerry Plugin for Microsoft Visual Studio -> Sample Browser

Last edited by brcewane : 08-23-2007 at 01:09 PM.
Offline  
Old 08-23-2007, 02:44 PM   #7 (permalink)
Knows Where the Search Button Is
 
Join Date: Aug 2007
Model: 8300
PIN: N/A
Carrier: developer
Posts: 16
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default chart

thank you
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.