Working With ASP.NET Chart Control

"Graph Speaks Louder than words(numbers)"

So, let's bind the lead data for the year 2011 to 2015 with ASP.NET Chart control in your website.

Step 1:
Create new ASP.NET Empty website and give a name 'WebChart'.

Step 2
: Add new Web Page by clicking on Add, then Web form.

Step 3
: Drag and drop Chart Control from the Toolbox, Data, then Chart on Web Form.

Step 4
: From the right top corner of the chart control Choose Data Source.

Step 5
: Choose SQL data source and give a name 'SqlDataSource1' and click Ok.

Step 6
: Connect this with SQL database, enter server detail and Login Credentials for login to SQL Server and select database.

Step 7
: Give a name to connection string, and click on next. It will add connection string in web.config file.

Step 8
: Now select the table and select the fields you want to bind in your Chart as X axis and Y axis.

Step 9
: Click on next and test your query, and click on finish.

Step 10 : That's it. Now save and run your website and it will display lead count for the respective years.


Hope you liked the simple steps to bind SQL data with ASP.NET Chart control.