-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed #6203, yAxis extremes were wrong calculated for visible scatter…
… points
- Loading branch information
1 parent
142173e
commit 1eace3d
Showing
4 changed files
with
40 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
samples/issues/highstock-5.0.9/6203-wrong-yaxis-extremes-scatter/demo.details
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
resources: | ||
- https://code.jquery.com/qunit/qunit-2.0.1.js | ||
- https://code.jquery.com/qunit/qunit-2.0.1.css | ||
... |
6 changes: 6 additions & 0 deletions
6
samples/issues/highstock-5.0.9/6203-wrong-yaxis-extremes-scatter/demo.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<script src="https://code.highcharts.com/stock/highstock.js"></script> | ||
|
||
<div id="qunit"></div> | ||
<div id="qunit-fixture"></div> | ||
|
||
<div id="container" style="width: 600px; margin: 0 auto"></div> |
27 changes: 27 additions & 0 deletions
27
samples/issues/highstock-5.0.9/6203-wrong-yaxis-extremes-scatter/demo.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
$(function () { | ||
QUnit.test('yAxis extremes should adapt to visible points, not all.', function (assert) { | ||
var chart = Highcharts.stockChart('container', { | ||
series: [{ | ||
data: [1, 2, 3, 4, 5, 3, 2, 1, 2, 4, 5, 8, 6, 4, 2, 3, 4, 2, 3, 4, 5, 6, 3, 2, 1, 2, 3, 4, 5, 6, 7, 3] | ||
}, { | ||
type: "scatter", | ||
data: [{ | ||
x: 4, | ||
y: 200, | ||
}, { | ||
x: 10, | ||
y: 2, | ||
}], | ||
|
||
}] | ||
}); | ||
|
||
chart.xAxis[0].setExtremes(8, 10); | ||
|
||
assert.deepEqual( | ||
chart.yAxis[0].max, | ||
10, | ||
'yAxis extremes adapted to visible scatter points.' | ||
); | ||
}); | ||
}); |
1eace3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I aware of failing 334 test, but looks like correct.
1eace3d
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That code snippet was written to include the point immediately outside the visible range to the left and right when finding Y extremes, but I am not sure if it's necessary. If this is the only failing test it is probably safe to merge it.