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

Highstock scrollbar issue with single point #5228

Closed
stimcon-dev opened this Issue Apr 19, 2016 · 4 comments

Comments

Projects
None yet
2 participants
@stimcon-dev

stimcon-dev commented Apr 19, 2016

When only one point is plotted on graph than date range scroll is not working but still if i try to scroll at edge's it's changing the position of point in Graph.

Can I stop this changing the position of point in graph ?

check fiddle here jsfiddle

Thanks

@jon-a-nygaard jon-a-nygaard added the Bug label Apr 20, 2016

@jon-a-nygaard jon-a-nygaard self-assigned this Apr 20, 2016

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Apr 20, 2016

Collaborator

@stimcon-dev Thanks for reporting. I am currently working on this issue and will come back to you as soon as I know some more.

Internal note: simplified demo

Collaborator

jon-a-nygaard commented Apr 20, 2016

@stimcon-dev Thanks for reporting. I am currently working on this issue and will come back to you as soon as I know some more.

Internal note: simplified demo

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Apr 20, 2016

Collaborator

This issue will be fixed in the next maintenance release. For those in need of an immediate fix, have a look at the workaround below.

Workarounds
Alternative 1: Drop in an override of getUnionExtremes before a chart is created, like in this example

Alternative 2: Open you source file highstock.src.js in a text editor. Search for the function getUnionExtremes and replace it with the following code

getUnionExtremes: function (returnFalseOnNoBaseSeries) {
    var baseAxis = this.chart.xAxis[0],
        navAxis = this.xAxis,
        navAxisOptions = navAxis.options,
        baseAxisOptions = baseAxis.options,
        ret;

    if (!returnFalseOnNoBaseSeries || baseAxis.dataMin !== null) {
        ret = {
            dataMin: pick( // #4053
                navAxisOptions && navAxisOptions.min,
                numExt(
                    'min',
                    baseAxisOptions.min,
                    baseAxis.dataMin,
                    navAxis.dataMin,
                    navAxis.min
                )
            ),
            dataMax: pick(
                navAxisOptions && navAxisOptions.max,
                numExt(
                    'max',
                    baseAxisOptions.max,
                    baseAxis.dataMax,
                    navAxis.dataMax,
                    navAxis.max
                )
            )
        };
    }
    return ret;
}
Collaborator

jon-a-nygaard commented Apr 20, 2016

This issue will be fixed in the next maintenance release. For those in need of an immediate fix, have a look at the workaround below.

Workarounds
Alternative 1: Drop in an override of getUnionExtremes before a chart is created, like in this example

Alternative 2: Open you source file highstock.src.js in a text editor. Search for the function getUnionExtremes and replace it with the following code

getUnionExtremes: function (returnFalseOnNoBaseSeries) {
    var baseAxis = this.chart.xAxis[0],
        navAxis = this.xAxis,
        navAxisOptions = navAxis.options,
        baseAxisOptions = baseAxis.options,
        ret;

    if (!returnFalseOnNoBaseSeries || baseAxis.dataMin !== null) {
        ret = {
            dataMin: pick( // #4053
                navAxisOptions && navAxisOptions.min,
                numExt(
                    'min',
                    baseAxisOptions.min,
                    baseAxis.dataMin,
                    navAxis.dataMin,
                    navAxis.min
                )
            ),
            dataMax: pick(
                navAxisOptions && navAxisOptions.max,
                numExt(
                    'max',
                    baseAxisOptions.max,
                    baseAxis.dataMax,
                    navAxis.dataMax,
                    navAxis.max
                )
            )
        };
    }
    return ret;
}
@stimcon-dev

This comment has been minimized.

Show comment
Hide comment
@stimcon-dev

stimcon-dev Apr 20, 2016

@jon-a-nygaard Thank you very much.
You guys are working superb.

stimcon-dev commented Apr 20, 2016

@jon-a-nygaard Thank you very much.
You guys are working superb.

@jon-a-nygaard

This comment has been minimized.

Show comment
Hide comment
@jon-a-nygaard

jon-a-nygaard Apr 21, 2016

Collaborator

@stimcon-dev Thanks, glad I could be of help.

Collaborator

jon-a-nygaard commented Apr 21, 2016

@stimcon-dev Thanks, glad I could be of help.

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