TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
AngularJS Simple ChartCreation
Anha Verma
Jul 15
2015
Code
1.1
k
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
<!DOCTYPE>
<html>
<head>
<script src=
"../script/jquery.min.js"
type=
"text/javascript"
></script>
<script src=
"../script/angular.min.js"
type=
"text/javascript"
></script>
<script src=
"../script/chart.js"
type=
"text/javascript"
></script>
<script type=
"text/javascript"
>
var app = angular.module(
'myApp'
, []);
app.controller(
'myCntrl'
, function ($scope) {
data: [10,20,30,40,50,60];
var chart = {
labels: [
"Jan"
,
"Feb"
,
"Mar"
,
"April"
,
"May"
,
"June"
],
datasets: [
{
label:
"My First Angula Chart"
,
fillColor:
"#578ebe"
,
strokeColor:
"rgba(24, 107, 2, 0.8)"
,
pointColor:
"rgba(24, 107, 2, 0.9)"
,
pointStrokeColor:
"#fff"
,
pointHighlightFill:
"#fff"
,
pointHighlightStroke:
"rgba(24, 107, 2, 1)"
,
data: data
},
]
};
var canvasChart = document.getElementById(
"canvasChart"
).getContext(
'2d'
);
new
Chart(canvasChart).Line(chart);
});
</script>
</head>
<body>
<div ng-app=
"myApp"
ng-controller=
"myCntrl"
>
<canvas id=
"canvasChart"
width=
"1000"
height=
"350"
></canvas>
</div>
</body>
</html>
AngularJS
charts
charts in AngularJS