c# - Dynamic Chart Shows no data MSCHART, only white chart appears -


here problem. need create multiple charts(number not known previously). so, generating dynamic chart. problem is, chart appears shows no data. blank white space.

private void form1_load(object sender, eventargs e) {     chart demo = new chart();     demo.location = new point(0, 0);     demo.size=new size(this.width,this.height);     demo.series.add("check");     datapoint dp1 = new datapoint(1, 1);     datapoint dp2 = new datapoint(2, 2);     datapoint dp3 = new datapoint(3, 3);     demo.series["check"].points.add(dp1);     demo.series["check"].points.add(dp2);     demo.series["check"].points.add(dp3);     this.controls.add(demo);     demo.bringtofront();     demo.visible = true; } 

output white chart nothing on it.

you need create chart area. add line in code.

demo.chartareas.add("newchartarea"); 

Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -