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

Bubble chart wrong X axis maximum calculated when min is set #8901

Closed
ivanmjartan opened this Issue Sep 6, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@ivanmjartan

ivanmjartan commented Sep 6, 2018

Hi there we have problem in our Bubble chart.

We have several series in bubble chart.

3 of them have X value [40542, 40907,41270] (3 bubbles) others are empty.

When we set min value of x axis to 40805 result graph is empty

Expected behaviour

there will be one bubble with value 41270

Actual behaviour

Graph is empty

Live demo with steps to reproduce

https://jsfiddle.net/9j07b3ym/

Try to remove "min": 40805 in x axis definition

Product version

We are using 4.2.5

Test repro version current

Affected browser(s)

@pawelfus

This comment has been minimized.

Show comment
Hide comment
@pawelfus

pawelfus Sep 7, 2018

Contributor

Hi @ivanmjartan

Thank you for reporting this bug. It looks like setting max resolves the issue too: https://jsfiddle.net/BlackLabel/9n0sjrae/

Simplified demo: https://jsfiddle.net/BlackLabel/9n0sjrae/4/

Internal note:
For some reason, xAxis.max is miscalculated:

< Highcharts.charts[0].xAxis[0].getExtremes();
> {
>   dataMax: 41013,
>   dataMin: 40542,
>   max: 40975.42787658802,
>   min: 40805,
>  userMax: undefined,
>   userMin: undefined
> }

Simple modification here:

transA *= (axisLength + pxMin - pxMax) / axisLength;

From pxMin - pxMax to Math.abs(pxMin - pxMax) looks better, but bubble is still cut off.

Contributor

pawelfus commented Sep 7, 2018

Hi @ivanmjartan

Thank you for reporting this bug. It looks like setting max resolves the issue too: https://jsfiddle.net/BlackLabel/9n0sjrae/

Simplified demo: https://jsfiddle.net/BlackLabel/9n0sjrae/4/

Internal note:
For some reason, xAxis.max is miscalculated:

< Highcharts.charts[0].xAxis[0].getExtremes();
> {
>   dataMax: 41013,
>   dataMin: 40542,
>   max: 40975.42787658802,
>   min: 40805,
>  userMax: undefined,
>   userMin: undefined
> }

Simple modification here:

transA *= (axisLength + pxMin - pxMax) / axisLength;

From pxMin - pxMax to Math.abs(pxMin - pxMax) looks better, but bubble is still cut off.

@pawelfus pawelfus added the Bug label Sep 7, 2018

@TorsteinHonsi TorsteinHonsi self-assigned this Sep 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment