C # Real-time line chart, waveform diagram

Source: Internet
Author: User
Tags time interval

Original URL: C # Real-time Line chart, waveform map source Download link in the original

Author: Flying Moon

Source: http://www.cnblogs.com/hsiang/


This demo uses the VS-band chart Chart control to produce a real-time, dynamically displayed line chart, and a waveform diagram.

It involves knowledge as follows: Chart control, powerful, can draw a histogram, line chart, waveform, pie chart, greatly simplifying the development and customization of the graph.

Chart Control Concepts: ChartArea, which represents the chart area, a chart can draw multiple ChartArea, overlapping. Series, which represents a sequence of data, each ChartArea can have multiple data lines. That is, series belongs to ChartArea. Axisx,axisy, which represents the primary axis, each chartarea has a corresponding axis, including the primary axis, the auxiliary axis queue set, which represents the first out of the collection.

There are two main methods: Dequeue () means to remove and return the object at the beginning of the system.collections.generic.queue<t>. Enqueue () indicates that the object is added to the end of the system.collections.generic.queue<t>. Timer, timer, timed trip corresponding function, update data, refresh chart.

-----------------------------------------------------------------------------------------------------------

The effect is as follows "click the initialization button First, then click the Start button":

Line chart, which is filled with the number of seconds between [0,100]:

Waveform Diagram "Waveform, is to take the positive and the value, and magnified 50 times times, and then move up 50"

The code is as follows: View code

About Timers Timer "Microsoft's own controls":

Description: Indicates that a user-defined event is raised at the same time interval. Implement the functionality that the user needs. This example is used to periodically update the data in the queue and refresh the chart.

Common instructions: Interval time interval, in milliseconds, this example is 300 milliseconds. Tick The event that is timed to trigger, this example corresponds to the Timer1_Tick event method. Start (), Stop () indicates the start and stop of the timer. Enabled indicates whether the timer is enabled, and the default value is false and needs to be set to true manually.

--------------------------------------------------------------------------------------------------------------- ---------------------------------------------------------------



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.