Using last version of D3.js broke tauCharts
Closed this issue · 3 comments
Using the last version of D3.js : <script src="//cdn.jsdelivr.net/d3js/latest/d3.min.js" charset="utf-8"></script>
with this code (the 1 minute example):
var defData = [{
type:'us', count:0, date:'12-2013'
},{
type:'us', count:10, date:'01-2014'
},{
type:'us', count:15, date:'02-2014'
},{
type:'us', count:12, date:'03-2014'
},{
type:'us', count:16, date:'04-2014'
},{
type:'us', count:13, date:'05-2014'
},{
type:'bug', count:21, date:'01-2014'
},{
type:'bug', count:19, date:'02-2014'
},{
type:'bug', count:23, date:'03-2014'
},{
type:'bug', count:26, date:'04-2014'
},{
type:'bug', count:23, date:'05-2014'
}];
var chart = new tauCharts.Chart({
guide:{
padding:{l:70, t:10, b:70,r:10},
showGridLines:'xy',
color:{
brewer:{
us:'color-us',
bug:'color-bug'
}
},
y:{
label:{
text:'Count of completed entities',
padding:50
}
},
x:{
label:'Month'
}
},
data: defData,
type: 'line',
x: 'date',
y: 'count',
color: 'type'
});
chart.renderTo('#prob-graph');
i use the last version of tauchart : <script src="//cdn.jsdelivr.net/npm/taucharts@1/build/production/tauCharts.min.js" type="text/javascript"></script>
this give the error :
TypeError: g.default is undefined
tauCharts.min.js:7:30926
ReferenceError: tauCharts is not defined
Note that using the version : 3.5.17 of D3.Js (as stated in the doc) works fine, the problem is with the last version of D3.Js (as stated in the README).
The fact is that //cdn.jsdelivr.net/d3js/latest/d3.min.js
references to D3 v4 which is not compatible with taucharts of version 1.
To use latest D3 v4 with taucharts - consider taucharts@2.1.0
You can reference it from here: //cdn.jsdelivr.net/npm/taucharts@2.1.0/dist/taucharts.min.js
Let me know if you have other questions.
In that case this :
<script src="//cdn.jsdelivr.net/taucharts/latest/taucharts.min.js" type="text/javascript"></scrip /script>
should be changed to this : <script src="//cdn.jsdelivr.net/npm/taucharts@2.1.0/dist/taucharts.min.js" type="text/javascript"></script>
(in the README)
The link is broken so people may be tempted to use the version presented in the doc (the link in the doc is for version 1) which may lead the error described above.
I can do a pull request if you want.
@ukarroum
I fixed readme. Thank you for notion