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 8163029
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T18:55:37+00:00 2026-06-06T18:55:37+00:00

I refresh the chart in Timer. When the function refresh chart only everything is

  • 0

I refresh the chart in Timer. When the function refresh chart only everything is OK, but when I add code to the USB communication the graph is updated (once) only when the function is complete.

timer.scheduleAtFixedRate(new TimerTask() {
public void run() {
    for (int i = 0; i < data[0].length; i++) {
        data[0][i] = getRandom(0, 20);
        data[1][i] = (i + 1);
    }

    lineGraph.refreshChart(data[0], data[1]);
    if (complete[0]) {
        timer.cancel();
        timer.purge();
        return;
    }

    }
}, 100, 100);

// without the following two lines works fine
usbPacketTransfer.send();
recivedData = usbPacketTransfer.recive();
  • 1 1 Answer
  • 0 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-06-06T18:55:39+00:00Added an answer on June 6, 2026 at 6:55 pm

    You need to move all of your network operations out of the main UI thread. I would recommend using AsyncTask or Thread to do this. Your network commands are blocking everything else from running which is why it only updates at the end.

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

Sidebar

Related Questions

In my code below, the data is updated but the chart is not redrawn
I have an ASP Chart that uses a timer to refresh an updatepanel, simulating
how to refresh the JSF panelgrid whenever data gets updated in db without refreshing
I need to refresh my Activity once i click my Tab activity back. Currently
I would like to refresh tk window when I push a button, but I
So I'm trying to update dataPoints programmaticaly in a column chart but whenever I
I'm using a lineseries chart, but it gets fairly slow to re-render when I
I 'm creating a Line chart using WPFToolKit. The chart comes up fine but
I am using telerik treeview with telerik chart control. I want to refresh/reload the
Refresh an int64edit and get selected element. I have an int64edit, when I select

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.