Monday, May 20, 2024
 Popular · Latest · Hot · Upcoming
154
rated 0 times [  155] [ 1]  / answers: 1 / hits: 16466  / 9 Years ago, tue, september 8, 2015, 12:00:00

I had previously installed my chart.js current version with bower.
For different reasons I have to use chart.js: https://github.com/nnnick/Chart.js/releases/tag/2.0.0-alpha3



I changed the name on my bower file to the current version and bower installed. But I keep getting this error.




TypeError: (intermediate value).Line is not a function




Here is my code:



var myNewChart = new Chart(ctx).Line(dat);

More From » charts

 Answers
80

In Chart.js 2.0.0 Alpha 3 you will need to create your chart like so:



var myNewChart = new Chart(ctx , {
type: line,
data: dat,
});


Fiddle Example



At least right now it doesn't have new Chart().Line() like the older version.



What your error basically means is that it was expecting a semi-colon after Chart(ctx).


[#65134] Monday, September 7, 2015, 9 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
josuea

Total Points: 609
Total Questions: 121
Total Answers: 104

Location: South Georgia
Member since Fri, Nov 13, 2020
4 Years ago
josuea questions
;