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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:23:58+00:00 2026-06-14T21:23:58+00:00

I am still pretty rough on this library given the lack of documentation. I

  • 0

I am still pretty rough on this library given the lack of documentation.

I have a ChartPlotter object which is showing data in real-time as it’s captured through capture of data from a device.
I have the following event that is invoked every time I have new data coming from the device:

    private void OnRawDataChanged(object sender, RawDataChangedEventArgs e)
    {
        System.Diagnostics.Debugger.Log(0, "event", "event received from data manager\n");
        System.Diagnostics.Debugger.Log(0, "event", e.NewRawDataSet.Length + " tuples of data returned\n");

        var batchSize = e.NewRawDataSet.Length;

        // Expected tuples of 2 values + 2 threshold values
        Point[][] points = new Point[4][];

        for (int i = 0; i < 4; i++)
        {
            points[i] = new Point[batchSize];
        }

        double period = 1.0 / Properties.Settings.Default.SamplingRate;

        for (int i = 0; i < batchSize; i++)
        {
            // Time is expressed in milliseconds
            double t = e.NewRawDataSet[i].Time / 1000.0;

            points[0][i] = new Point(t, e.NewRawDataSet[i].Sensors[0]);
            points[1][i] = new Point(t, e.NewRawDataSet[i].Sensors[1]);
            points[2][i] = new Point(t, parentForm.PressureHisteresysOpen);
            points[3][i] = new Point(t, parentForm.PressureHisteresysClose);
        }

        plotter.Dispatcher.Invoke(DispatcherPriority.Normal,
            new Action(() =>
                {
                    sensor0.AppendMany(points[0]);
                    sensor1.AppendMany(points[1]);
                    pressureOpen.AppendMany(points[2]);
                    pressureClose.AppendMany(points[3]);
                }));
    }

With the standard settings of the ChartPlotter, the graph will auto-fit in the window.
I would like to have the horizontal axis automatically scroll left showing only the last 10 seconds (for example) of capture. Is there a way to achieve this?

Thanks

  • 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-14T21:23:59+00:00Added an answer on June 14, 2026 at 9:23 pm

    To achieve this you have to modify the plotter.ViewPort.Visible property. This property takes a DataRect object that you construct with values to form a rectangle. Everytime you recieve a new piece of data, you would have to recalculate this rectangle so that your graph will scroll to view.

    Here is an example of constructing a DataRect :

            double yMin = 1;
            double yMax = 10;
            double xMin = 1;
            double xMax = 10;
            plotter.ViewPort.Visible = new DataRect(xMin, yMin, xMax - xMin, yMax - yMin); 
    

    Your mins and maxs will be based on the type of data on your axis.

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

Sidebar

Related Questions

Still pretty green on clojure, java, layouts etc. On a miglayout I have this
Im still pretty new so bear with me on this one, my question(s) are
I am still pretty new to using jQuery to do anything, but I have
Question ONE: I'm still pretty new to .net, but have used Visual Studio for
Im still pretty new to NHibernate.Search so please bear with me if this is
I have a still pretty simple Rails application that I want to develop using
I'm still pretty new to android programming, so this may be something easy I'm
Still pretty new to ObjectiveC and Cocoa here. Hopefully the answer to this question
I'm still pretty new to Objective-C coding (as evidenced by this question) and I
So basically I am still pretty new to Python and I have a problem

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.