-Displayed as a line graph with C #, Series is about 10 items, Points is more than 20000
・ Points are added every 100ms
The following two under the situation of
① Smoothly zoom in and out with the mouse wheel
(2) Move the vertical line cursor at the click position with the "button to move the cursor to the left" and the "button to move the cursor to the right"
I want to realize.
① can be scaled up and down, but the overall operation becomes very heavy when the number of data (Points) exceeds 5000.
I'm currently adding data with Points.AddXY. Is there a factor that increases the way the data is held?
Chart.Series [0] .Points.AddXY (cnt, double.Parse (data [0]));
Chart.Series [1] .Points.AddXY (cnt, double.Parse (data [1]));
…
Chart.Series [N] .Points.AddXY (cnt, double.Parse (data [N]));
②, you can set the vertical line cursor at the click position, but I do not know how to move the vertical line cursor with the left and right keys.
When you click the mouse, you can set the vertical line cursor as follows. However, you can see the setting of the information corresponding to the following mousePoint in the click event of the "button to move the cursor to the left" or "button to move the cursor to the right". There is no situation.
Point mousePoint = New Point (e.X, e.Y);
Chart1.ChartAreas (0) .CursorX.SetCursorPixelPosition (mousePoint, True);
Can you give me advice?
-
Answer # 1
-
Answer # 2
It is better to keep the Parseed data than to Parse every time.
How about using Chart.DataSource?
Related articles
- c # - i want to add speed only for the time the unity key is pressed
- c # timer settings and processing speed
- Python implementation example of drawing a graph using matplotlib in tkinter
- Analysis of Python scatter plot and line graph drawing process
- c # - move the character at a constant speed
- Python implements association graph drawing based on pyecharts
- graph drawing in ruby or c
- i want to speed up tesseract jpn processing (windows10, visual studio 2019, c #, net 47)
- graph drawing with numpy and matplotlib
- javascript - chartjs about graph drawing
- c # - if you hit a bullet at a close distance, the speed will be 0
- graph drawing using python pandas matplotlib
- c # - in unity, i want to keep the speed of moving objects constant
- c # - unity3d: rigid body speed limit
- c # - i have a question about drawing polygons and textures on ios
- c # - maintain current speed with vector3
- python - graph drawing with matplotlib
- i want to get a triangle split from a delaunay graph in c #
- C # method of drawing a graph
・ About speed
Instead of adding all the data with AddXY, it is improved if you pass the data that is thinned out moderately. Even if a graph with more than 1000 points is displayed, it is meaningless because it cannot be seen when considering the screen resolution.
5000 * 8 * 2 = 80KB is enough to fit in the CPU L1 cache. It is natural that if data of this size is scanned frequently and drawing processing is performed, it will be slow. Eventually, 320KB and data that does not fit in the L2 cache are targeted, so it will be significantly slower unless it is thinned out to a reasonable extent.