Skip to content
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

Specify x and y crosshair scales to support non annotation based crosshair plotting #20

Closed
andredumas opened this issue Nov 2, 2014 · 0 comments

Comments

@andredumas
Copy link
Owner

Crosshair currently default's x and y scales to the first annotation element annotation arrays. This assumes there are always annotations associated. It would be better to explicitly set x and y scales, and also be able to plot crosshairs without annotations.

Before:

    var crosshair = techan.plot.crosshair()
            .xAnnotation([timeAnnotation, timeTopAnnotation])
            .yAnnotation([ohlcAnnotation, ohlcRightAnnotation]);

After:

    // Without annotations
    techan.plot.crosshair()
            .xScale(timeAnnotation.axis().scale())
            .yScale(ohlcAnnotation.axis().scale());

    // With annotations
    techan.plot.crosshair()
            .xScale(timeAnnotation.scale())
            .yScale(ohlcAnnotation.scale())
            .xAnnotation([timeAnnotation, timeTopAnnotation])
            .yAnnotation([ohlcAnnotation, ohlcRightAnnotation]);
@andredumas andredumas added this to the 0.4.0 milestone Nov 2, 2014
@andredumas andredumas changed the title [API CHANGE] Specify x and y crosshair scales to support non annotation based crosshair plotting Specify x and y crosshair scales to support non annotation based crosshair plotting Nov 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant