I have a line chart by nvd3
Here is my code:
var categories = color.domain().map(function(name) {
return {
key: name,
values: data.map(function(d) {
return {
seme: d.Semester,
stat: d[name],
area: true
};
})
};
}); // end of categories
nv.addGraph(function() {
var chart = nv.models.lineChart()
.x(function(d) { return parseFloat(d.seme); })
.y(function(d) { return parseFloat(d.stat); })
.color(['#ffbb78', '#ff7f0e', '#aec7e8', '#1f77b4'])
.margin({left: 100})
.transitionDuration(350)
.showLegend(true)
.showYAxis(true)
.showXAxis(true)
.width(width).height(height);
chart.isArea(true);
This is my graph:
I want all semester values to appear, so how can I force the x-axis to show all values of semester?
I tried this one
chart.xAxis.axisLabel("Semester")
.showMaxMin(false)
.tickValues(function(d) { return parseFloat(d.seme); })
.tickFormat(d3.format(',f'));
and here what I have got: