facebook

How can I create a Line Chart? CLOSED

  1. MobiOne Archive
  2.  > 
  3. Getting Help – General
Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #338917 Reply

    Hi everyone, I wish to include a line chart in my project to display and compare 2 arrays of values. Does Mobione support Chart Plugins? If not does anyone suggest how I might do this-I would greatly appreciate it?

    #338933 Reply

    support-michael
    Keymaster

    @phillda

    MobiOne does not provide a chart library but you can integrate one using the HTML widget. You can see an example of a demo I created for plotting acelerometer data off my phone using the smoothie-chart library. You can see the chart in this screencast http://www.genuitec.com/mobile/ scroll to bottom of screen. The chart is rendered at about 2:20 min/sec. You need to be careful that the library is fully supported on your target devices. For example if the charting lib requires use of <canvas> you may find it runs inconsistently across different versions of iOS and Android.

    #338948 Reply

    Thanks so much for the quick response Wayne, I will check out smoothie-charts and see how I go.

    #339051 Reply

    Hi Wayne I have had trouble getting smoothie-charts to work. I have tried to attach a word doc showing what I did but this is rejected so here is the text without pictures below-hope you can help, regards Dave.

    I downloaded and a page of code appeared in my browser.
    I selected ‘save page as’

    I saved in a folder I called Plugins.

    In mobione design centre I made a page called ‘smoothietrial’

    I added the smoothie file to javascript libraries in the properties window of smoothietrial.mobi

    I placed a html widget on the page and from properties added the html code suggested on the smoothie-charts web page http://smoothiecharts.org/tutorial.html as shown below.

    Here is the result

    #339137 Reply

    @phillda,

    Wayne is working on a example. We’ll follow up with you as soon as it is finished.

    #339229 Reply

    Thanks guys, that would be great.

    #340592 Reply

    Hi Octavio and Wayne, have you had any luck with the line chart example. I don’t mean to be a pest but it was May 20th when you you last indicated you were working on an example so I thought you may have got caught up with other issues, regards Dave.

    #340637 Reply

    support-michael
    Keymaster

    @phillda

    The delay has been due to an upgrade of the smoothie charts js lib that I was using. It uses a feature not supported by the older Test Center javascript engine. Thus, I have held off until we have the implementation ready. If all goes well we should make available the mobione 2.5 milestone-1 release this week.

    #341642 Reply

    Hi Wayne, have you been able to make any progress?

    #341650 Reply

    support-michael
    Keymaster

    Here is an article and example project: http://www.genuitec.com/support-genuitec/viewtopic.php?f=14&t=5997

    Apologies for the delay in posting an article on adding a line chart to mobione. I am still working on how to avoid a scaling issue in the smoothie when rescaling the UI.

    #342071 Reply

    Thanks Wayne, I can get this to work, however I don’t seem to able to resize the HTML widget to fill the width of the screen (for iPad). Also is there a way to have the chart time series evolve from left to right and slow it so that all data stays on screen. I wish to use a chart to display the score of two teams for a sporting match to show how the scores evolved over the entire game. Perhaps smoothie charts is not the appropriate choice-if so can you point me toward a charting tool that may suit, thanks again for your help, cheers, Dave.

    #342078 Reply

    support-michael
    Keymaster

    yea, I’m wondering if smoothie charts is the right choice. I have only messed with smoothie on another project that plots device accelerometer measurements. One of the issues I had was configuring the chart to rescale to fill an html widget container. I fought it for a while but then opted to just go with the default size of the chart otherwise scaling was dorked. I have not researched other charting/graphing libs. The integration should be somewhat similar to this example.

    #342307 Reply

    Thanks Wayne, I have been able to resize the chart by specifying the height and width in the HTML widget using
    <canvas id=”xhtml-canvas” width=”1024″ height=”129″>
    </canvas>
    Also the smoothie website has a ‘smoothie builder’ that enables you to use sliders to alter parameters and introduce new ones.
    http://smoothiecharts.org/builder/

    This has enabled me to slow the chart so that all my data stays on screen. Anyway I am making good progress now and getting a better feel for how to use the HTML widget. Thanks again for your help, regards Dave.

Viewing 13 posts - 1 through 13 (of 13 total)
Reply To: How can I create a Line Chart? CLOSED

You must be logged in to post in the forum log in