How many curves can be added in ZedGraph at most in WinForm



In winforn, set the properties of ZedGraph curve, coordinate axis and scale:

When adding curves to ZedGraph, if you need to add a large number of curves, you can add up to how many curves.

Before you can test how many curves you can add, you need to turn off the legend of ZedGraph so that it doesn’t display. Otherwise, the following effect will be displayed at 134.




Blog home page:

Pay attention to the public address
Domineering procedural ape
Get programming related ebooks, tutorials and free downloads.


Turn off the legend display first

myPane.Legend.IsVisible = false;


Then write the code to cycle the curve

//Make some data. There is an array of data pairs X and Y in pointpairlist
            Random y = new Random();
            for (int i = 1; i < 201;i++ )
                PointPairList list1 = new PointPairList();
                for (int j = 0; j < 50; j++)
                    double x = j;
                    double y1 = y.NextDouble() * 1000;
                    LIST1. Add (x, Y1); // add a set of data
                Lineitem mycurve = mypane.addcurve (curve + I, LIST1, color. Red, symboltype. None);


Where the number of cycles minus 1 is the number of curves

Here are the effects of 200 curves



The curve is already very dense, and the rendering time is very long, close to 5 seconds

Continue adding 800 curves



Continue to add to 10000



Continue adding 18000, and the rendering time has reached 15 seconds




Continue to add to 20000


There’s no need to test later, 20000 curves can’t be seen, and the rendering time has reached more than 20 seconds.

But it’s still that the curve data is relatively simple, and the rendering time will be longer in the actual business scene without taking business to obtain data.

Recommended Today

explain profound theories in simple language Node.js Learning notes (11)

Productization 1. Project engineering The so-called engineering can be understood as the organizational capacity of the project. Reflected in the 1.1 directory structure The main two types of projects are web application and module application. Common module applications follow the module and package specifications of commonjs. For web applications, there are various ways of organization, […]