Open thomai-d opened 7 years ago
I have a similar issue, where the right axis is so much off, that the graph is not being shown at all:
var items = [
{x: "2017-08-07", y: 1, group: 0},
{x: "2017-08-09", y: 1, group: 0},
{x: "2017-08-07", y: 0, group: 1},
{x: "2017-08-09", y: 12, group: 1},
];
groups = new vis.DataSet();
groups.add({
id: 0,
content: 'Group Left',
});
groups.add({
id: 1,
content: 'Group Right',
options: {'yAxisOrientation': 'right'},
});
var options = {
interpolation: false,
};
I have looked into the code in vis.js and have identified the method DataScale.prototype.followScale
to mess up the range (i.e. this._start
and this._end
) of the right axis.
I assume, that this method is meant to align the horizontal lines in the background of the plot, but can't really comprehend the code to fix it myself.
When drawing a line chart with two axis and individual axis-range, the right axis sometimes shows the wrong range.
You can reproduce the problem using the Both axis example. Just modify the initialization on the bottom to the following code:
As you can see, the right axis should display something around 1000 to 2000, but it actually shows 1500 to 2000.
RightAxisWrongRange.zip