-
Notifications
You must be signed in to change notification settings - Fork 19.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FIX #11176 xAxis.axisTick.interval appears different between echart4 and echart3.8 #11186
Conversation
Thanks @foolzhang ! Can you add add a test in the https://github.com/apache/incubator-echarts/blob/release/test/axis-interval.html |
how about this time @pissang |
Scheduled in the version 4.5.0 |
@@ -315,7 +320,10 @@ function fixOnBandTicksCoords(axis, ticksCoords, tickCategoryInterval, alignWith | |||
ticksItem.coord -= shift / ((tickCategoryInterval + 1) * 2); | |||
} | |||
}); | |||
last = {coord: ticksCoords[ticksLen - 1].coord + shift}; | |||
|
|||
diffSize = tickLen - ticksCoords[ticksLen - 1].tickValue; |
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 think this should be
diffSize = tickLen - crossLen;
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.
@pissang thanks your time , i am feel sorry about not consider dataZoom , but if like this
diffSize = tickLen - ticksCoords[ticksLen - 1].tickValue; | |
diffSize = diffSize = tickLen - crossLen; |
in my test demo axis-interval.html
{
show: true,
interval: function (index) {
// [false, true, true, false],
// [false, true, false, true],
return testArr[dataIndex][index]
}
axis's lastTick will last.
eg:[false, true, true, false]
eg:[false, true, false, true]
i review my submit , i think init tickLen should like this
var dataExtent = this.scale.getExtent();
// obtain all the ticks
var tickLen = this.scale.getTicks().length + dataExtent[0];
fixOnBandTicksCoords(
this, ticksCoords, result.tickCategoryInterval, alignWithLabel, opt.clamp,tickLen
);
...
after that, i test my case and axis-interval2.html with dataZoon, it's work now.
will pull request again, thanks you time again
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.
Great! Looks good to me now:)
Hi @foolzhang. I checked the code. Very neat fix! But it breaks the test case with dataZoom in axis-interval2.html. I've left my change suggestions in the comment. Really nice job! |
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.
@pissang thank you
src/coord/Axis.js
Outdated
var tickLen = this.scale.getTicks().length; | ||
var dataExtent = this.scale.getExtent(); | ||
var tickLen = this.scale.getTicks().length + dataExtent[0]; |
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.
major changes
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.
There are some formatting problems. But I think it's OK to merge this first.
…hart4 and echart3.8 (apache#11186) * FIX apache#11138 DOC ERROR * fix issues/11176 * delete console.log * add test demo * fix bug axis tick with dataZoom attr
different display in version 3.6 and 4 with xAxis.axisTick.interval