this.options = {
chart: {
type: 'linePlusBarChart',
height: 500,
margin: {
top: 30,
right: 75,
bottom: 50,
left: 75
},
bars: {
forceY: [0]
},
bars2: {
forceY: [0]
},
color: ['#2ca02c', 'darkred'],
x: function(d, i) { return i; },
xAxis: {
axisLabel: 'X Axis',
tickFormat: (d) => {
let dx = this.data[0].values[d] && this.data[0].values[d].x || 0;
return dx;
}
},
x2Axis: {
tickFormat: (d) => {
let dx = this.data[0].values[d] && this.data[0].values[d].x || 0;
return dx;
},
showMaxMin: false
},
y1Axis: {
axisLabel: 'Y1 Axis',
tickFormat: function(d){
return d3.format(',f')(d);
},
axisLabelDistance: 12
},
y2Axis: {
axisLabel: 'TargetLine Axis',
rotateLabels: -35,
}
}
};
I want to set y1Axis range explicitly something like 1 to 100. How can I do that?
In documentation of d3 I've found tickValues But I'm not sure how I can use this method into above configuration object.
Thanks in advance for any kind of help.
Found the answer. Just for further reference if someone needs that later.
No need to change
y1Axisbecause it's used by lines. so if we just force line to follow any guidelines for y-axis it'll do the trick.