Introduction
In this article, we will learn MVC, using Angular Pie chart, which is used for two types of UI, which are given below.
- Angular Knob Pie Chart.
- Angular Easy Pie Chart.
Angular Knob
Output 1

Create MVC Project
Open Visual Studio 2015.

Go to New menu > click New & project. Now, it will open New Project Window.

You can select ASP.NET Web Application on Framework 4.6. Enter the name of project in Solution name textbox, followed by clicking OK button.

One more Window should be appearing. Select MVC template in this popup & click OK button. Now, you can start to play.
Configure Angular Knob
We will download Knob plug in from
Features
- It works based on canvas.
- Can implement keyboard event.
- Can change UI touch, mouse & mouse wheel.
- Overloads an input element.
Open the _Layout.cshtml and must refer the min.js file in this view page.
- <script src="~/Plugin/angular-knob/src/angular-knob.js"></script>
- <script src="~/Plugin/jquery-knob/dist/jquery.knob.min.js"></script>
Open the Angular module and make its injection of Knob as ui-knob.
- var uiroute = angularmodule('uiroute', ['ui.router', 'ui.knob']);
Open the HTML page, make it design, using knop element & attribute.
- <knob knob-data="knobLoaderData1" -options="knobLoaderOptions1" knob-max="100"> </knob>
Set the values for the attribute. Open the “angular controller” files and hard code an input or you may get & bind the values from the Server side.
- $scope.knobLoaderData1 = 80;
- $scope.knobLoaderOptions1 = {
- width: '50%',
- displayInput: false,
- fgColor: '#0f5889'
- };
You have some option to change Pie Chart UI.
- $scope.knobLoaderOptions2 = {
- width: '50%',
- displayInput: true,
- fgColor: '#09a564',
- readOnly: true,
- lineCap: 'round'
- };
- $scope.knobLoaderOptions3 = {
- width: '50%',
- displayInput: true,
- fgColor: '#a50958',
- displayPrevious: true,
- thickness: 0.1
- };
- $scope.knobLoaderOptions4 = {
- width: '50%',
- displayInput: true,
- fgColor: '#a50909',
- bgColor: '#a54a09',
- angleOffset: -125,
- angleArc: 250
- };



Mohamed ElqassasPosted May 25, 2017, 1:53 PM
Great, Thanks for sharing!