c# - Winforms chart is empty -


i made simple project default winforms chart no changes , button.

public partial class form1 : form {     public dictionary<int, double> l { get; set; }     public form1()     {         initializecomponent();          l = new dictionary<int, double>();         chart1.datasource = l;         chart1.series[0].xvaluemember = "key";         chart1.series[0].yvaluemembers = "value";      }      private void generate(object sender, eventargs e)     {         l.clear();         random r = new random();         (int = 0; < numbernud.value; i++)         {             l.add(i, r.nextdouble() * 100);         }     } } 

but after click chart still empty. datasource have values, chart1.series[0].points.count == 0 did miss something?

do call generate method somewhere? should first call can fill dictionary random values.


Comments

Popular posts from this blog

c++ - OpenCV Error: Assertion failed <scn == 3 ::scn == 4> in unknown function, -

php - render data via PDO::FETCH_FUNC vs loop -

The canvas has been tainted by cross-origin data in chrome only -