How To Implement Google Pie Chart Dynamically Using Entity Framework In ASP.NET

In this article, I will demonstrate how to implement Google Pie Chart dynamically using Entity Framework in ASP.NET.

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.

  1. CREATE TABLE [dbo].[CompanyAnnualReport](  
  2.     [ID] [int] IDENTITY(1,1) NOT NULL,  
  3.     [DepartmentName] [nvarchar](50) NULL,  
  4.     [EmployeeHired] [intNULL,  
  5.  CONSTRAINT [PK_CompanyAnnualReport] PRIMARY KEY CLUSTERED   
  6. (  
  7.     [ID] ASC  
  8. )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ONON [PRIMARY]  
  9. ON [PRIMARY]  
  10.   
  11. GO  
ASP.NET

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.