Property 'ordinal' of undefined
See original GitHub issueHi, I have tried a simple copy-paste example but wouldn’t work. There is this error thrown
ypeError: Cannot read property 'ordinal' of undefined at Object.a.models.discreteBar (nv.d3.min.js:4) at Object.a.models.discreteBarChart (nv.d3.min.js:5) at Object.updateWithOptions (angular-nvd3.min.js:1) at Object.refresh (angular-nvd3.min.js:1) at Object.<anonymous> (angular-nvd3.min.js:1) at Object.fn (angular-nvd3.min.js:1) at n.$digest (angular.min.js:132) at n.$apply (angular.min.js:135)
However, my code
in html
<nvd3 options="options" data="data"></nvd3>
and dependables in my gulpfile;
'lib/moment.min.js',
'lib/d3.min.js',
'lib/nv.d3.min.js',
'lib/angular-nvd3.min.js',
and the controller looks like
$scope.options = {
chart: {
type: 'discreteBarChart',
height: 450,
margin : {
top: 20,
right: 20,
bottom: 50,
left: 55
},
x: function(d){return d.label;},
y: function(d){return d.value;},
showValues: true,
valueFormat: function(d){
return d3.format(',.4f')(d);
},
duration: 500,
xAxis: {
axisLabel: 'X Axis'
},
yAxis: {
axisLabel: 'Y Axis',
axisLabelDistance: -10
}
}
};
$scope.data = [
{
key: "Cumulative Return",
values: [
{
"label" : "A" ,
"value" : -29.765957771107
} ,
{
"label" : "B" ,
"value" : 0
} ,
{
"label" : "C" ,
"value" : 32.807804682612
} ,
]
}
]
Issue Analytics
- State:
- Created 7 years ago
- Comments:7
Top Results From Across the Web
Cannot read property 'ordinal' of undefined for d3.js
I've rewritten my program but the problem seems to be the ordinal scale of d3.js. I don't if because i'm using the v5...
Read more >Cannot read property 'ordinal' of undefined · Issue #46 - GitHub
When I try to run the sample script on my machine. I get this error: d4.js:95 Uncaught Error: [d4] The scale type: "ordinal"...
Read more >Angularjs TypeError Cannot read property ordinal of undefined
This article will explain you how to resolve angularjs TypeError: Cannot read property 'ordinal' of undefined. This error is mainly due to “d3”...
Read more >d3.scaleOrdinal - Observable
First, a definition: a scale is said to be categorical if its domain is a discrete set, and ordinal if that set is...
Read more >Ordinal number - Wikipedia
In set theory, an ordinal number, or ordinal, is a generalization of ordinal numerals aimed to extend enumeration to infinite sets.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hi seems like you are using d3 version 4. Version of 3 are supported.
thanks