Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3612516
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T22:00:32+00:00 2026-05-18T22:00:32+00:00

Has anyone already used Flot in Android? I’ve been reading this http://rapidandroid.org/wiki/Graphing and i’ve

  • 0

Has anyone already used Flot in Android?

I’ve been reading this http://rapidandroid.org/wiki/Graphing and i’ve re-used a code that i had that is working on a web site.

The problem is that the graphic doesn’t render.

Something like this:

————– JAVASCRIPT THAT GETS THE DATA ——————–

    if ($('#newsStatsCheckbox').is(':checked')) {

        $.ajax( {
            url : mobileClippingStatistics.baseUrl
                    + "countNews.json?aggregation="
                    + $("#aggregation").val() + "&start="
                    + $("#start").val() + "&end=" + $("#end").val(),
            type : "GET",
            dataType : "json",
            success : mobileClippingStatistics.addToGraphic,
            error : function(xhr, ajaxOptions, thrownError) {
                console.error("News hits data is not available...");
                console.error(xhr.status);
                console.error(thrownError);
                alert("News hits data is not available...");
            }
        });

    }

————- OTHER METHODS ———-

          addToGraphic : function(jsonData) {
    // To keep the colors the same  

    if (typeof jsonData == 'string') {
        var splitData = jsonData.split(" ");

        for ( var i = 0; i < splitData.length - 1; i++) {
            var json = eval('(' + splitData[i] + ')');

            json.color = mobileClippingStatistics.plotDataColor;

            mobileClippingStatistics.plotData.push(json);
            mobileClippingStatistics.plotDataBackup.push(json);

            var div = $("<div style='padding-right:10px; position:relative; float:left;' />");

            var label = $("<label/>");
            label
                    .html(mobileClippingStatistics.plotData[mobileClippingStatistics.plotData.length - 1].label);

            var check = $('');
            check.attr('id', "checkbox"
                    + mobileClippingStatistics.plotDataColor);

            div.append(label);
            div.append('<input id="checkbox'+mobileClippingStatistics.plotDataColor+'" type="checkbox" checked="checked" onchange="mobileClippingStatistics.refreshGraphic()" />');

            $("#plotOptions").append(div);

            mobileClippingStatistics.plotDataColor++;

        }

    }

    else {
        jsonData.color = mobileClippingStatistics.plotDataColor;
        mobileClippingStatistics.plotData.push(jsonData);
        mobileClippingStatistics.plotDataBackup.push(jsonData);

        div = $("<div style='padding-right:10px; position:relative; float:left;' />");

        var label = $("<label/>");
        label
                .html(mobileClippingStatistics.plotData[mobileClippingStatistics.plotData.length - 1].label);

        check = $('<input type="checkbox" checked="checked" onchange="mobileClippingStatistics.refreshGraphic()" style="padding-right:10px; />');
        check.attr('id', "checkbox"
                + mobileClippingStatistics.plotDataColor);

        div.append(label);
        div.append('<input id="checkbox'+mobileClippingStatistics.plotDataColor+'" type="checkbox" checked="checked" onchange="mobileClippingStatistics.refreshGraphic()" />');

        $("#plotOptions").append(div);

        mobileClippingStatistics.plotDataColor++;

    }

    mobileClippingStatistics.plotGraphic();

},

plotGraphic : function() {

    // Plot graphic
    var plot = $.plot($("#plot"), mobileClippingStatistics.plotData,
            mobileClippingStatistics.options);

    var overview = $.plot($("#plotOverview"),
            mobileClippingStatistics.plotData, {
                series : {
                    lines : {
                        show : true,
                        lineWidth : 1
                    },
                    shadowSize : 0
                },
                xaxis : {
                    ticks : [],
                    mode : "time"
                },
                yaxis : {
                    ticks : [],
                    autoscaleMargin : 0.1
                },
                selection : {
                    mode : "x"
                },
                legend : {
                    show : false
                }

            });

    mobileClippingStatistics.showPlots();

    $("#plot").bind(
            "plotselected",
            function(event, ranges) {
                // do the zooming

                plot = $.plot($("#plot"),
                        mobileClippingStatistics.plotData, $.extend(true,
                                {}, mobileClippingStatistics.options, {
                                    xaxis : {
                                        min : ranges.xaxis.from,
                                        max : ranges.xaxis.to
                                    }
                                }));

                // don't fire event on the overview to prevent eternal loop
                overview.setSelection(ranges, true);
            });

    $("#plotOverview").bind(
            "plotselected",
            function(event, ranges) {
                // plot.setSelection(ranges);
                $("#plot").html("");
                $.plot($("#plot"), mobileClippingStatistics.plotData, $
                        .extend(true, {}, mobileClippingStatistics.options,
                                {
                                    xaxis : {
                                        min : ranges.xaxis.from,
                                        max : ranges.xaxis.to
                                    }
                                }));
            });

},

defineOptions : function() {
    mobileClippingStatistics.options = {
        lines : {
            show : true
        },
        points : {
            show : true
        },
        xaxis : {
            mode : "time"
        },
        yaxis : {
            min : 0
        },

        grid : {
            markings : mobileClippingStatistics.weekendAreas
        }

    };

},

The graphic doesn’t render, although the divs/checkboxs with the data name render.

Ideias?

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T22:00:33+00:00Added an answer on May 18, 2026 at 10:00 pm

    Got this to work.

    First plot the graphic without data.

    Then get the data, and replot it.

    Some other fixes/modifications were done so I isn’t easy to post a single modification that put this to work.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Has anyone ever used the hidden class PackageParser in Android source code with java
Has anyone else come across this at all? I used to be able to
Telerik claims their controls work with ASP.NET MVC now. Has anyone already used the
I'm trying to bevel paths in core graphics. Has anyone done this already for
Is there anyone who has already tried to use the Microsoft Bing translator web
Has anyone used Hazelcast (preferably 2.1) with play framework 2.0/2.1 (not 1.2+)? I am
Has anyone ever run into this issue before? Sometimes the string displays, sometimes half
Has anyone met this error? Right now i am trying to do switch from
Has anyone ever used Solrnet inside CLR Stored Procedures? I would really appreciate pointers
To get the core question out of the way first: has anyone used the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.