Introduction
In this article. I will demonstrate how to implement Google Pie Chart dynamically using Entity Framework in ASP.NET. I will use jQuery AJAX to retrieve the data from database and display in Google Pie Chart. The chart will display the respective data on its point line with animation.
Step 1
Open SQL Server 2014 and create a database table to insert and retrieve the data.
- CREATE TABLE [dbo].[CompanyAnnualReport](
- [ID] [int] IDENTITY(1,1) NOT NULL,
- [DepartmentName] [nvarchar](50) NULL,
- [EmployeeHired] [int] NULL,
- CONSTRAINT [PK_CompanyAnnualReport] PRIMARY KEY CLUSTERED
- (
- [ID] ASC
- )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
- ) ON [PRIMARY]
-
- GO
Step 2
Open Visual Studio 2015 >> New Project and create an empty web application project.
Screenshot for creating new project 1
After clicking on New Project, one window will appear. Select Web from the left panel, choose ASP.NET Web Application, give a meaningful name to your project and then click on OK.
Screenshot for creating new project 2
After clicking on OK, one more window will appear. Choose Empty >> check on Web Forms checkbox and click on OK.
Screenshot for creating new project 3
Step 3
Click on Tools >> select NuGet Package Manager. Then, choose Manage NuGet Packages for Solution and click on it.
Screenshot for NuGet Package
After that, a window will appear. Choose Browse type bootstrap and install the package in the project.
Similarly, type jQuery and install the latest version of jQuery package in the project from NuGet; then close NuGet Solution.