Thursday, August 8, 2019

asp.net - How to set Chart control width into percentage

In asp.net chart control, how do we set chart width into percentage, below scenario is chart width needs to be set with the panel width. As the chart takes only pixel. Help on this.







































code behind:
protected void Page_Load(object sender, EventArgs e)
{



Chart2.Series[0].Points.AddXY(1, 1);
Chart2.Series[0].Points.AddXY(1, 2);
Chart2.Series[0].Points.AddXY(2, 1);
Chart2.Series[0].Points.AddXY(2, 2);
Chart2.Series[0].Points.AddXY(3, 1);
Chart2.Series[0].Points.AddXY(3, 2);


Chart3.Series[0].Points.AddXY(1, 10);
Chart3.Series[0].Points.AddXY(1, 20);
Chart3.Series[0].Points.AddXY(2, 10);
Chart3.Series[0].Points.AddXY(2, 20);
Chart3.Series[0].Points.AddXY(3, 10);
Chart3.Series[0].Points.AddXY(3, 20);


}




enter image description here

No comments:

Post a Comment

hard drive - Leaving bad sectors in unformatted partition?

Laptop was acting really weird, and copy and seek times were really slow, so I decided to scan the hard drive surface. I have a couple hundr...