Skip to content

Set marker size in data coordinates, not just pixels #2118

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

Closed
molehillrocker opened this issue Oct 25, 2017 · 5 comments
Closed

Set marker size in data coordinates, not just pixels #2118

molehillrocker opened this issue Oct 25, 2017 · 5 comments
Labels
feature something new

Comments

@molehillrocker
Copy link

At the moment we use symbols to display some kind of "measurement threshold" for a couple of grouped bar charts. This looks nice in the first place, since the symbols are as wide as the bars. However when the user zooms in, the bar groups are scaled but the symbols remain as wide as before, leading to the effect that is shown in the attached screenshot.

image

We also tried to use a separate trace that renders as line (lines+markers), but we didn't make it to draw it dashed in a way that each dash spans a single bar group and each gap between two bar groups remains empty (see next screenshot).

image

It would be nice if this could be achieved by either using symbols (a line in our case) that automatically stretches horizontally, or use lines+markers with gaps (and thus no interconnection between the markers, something like the hvh line shape seen here without the vertical sections.

@alexcjohnson
Copy link
Collaborator

alexcjohnson commented Oct 25, 2017

If this is a numeric x axis you should be able to get what you want by adding null or '' between the segments

{
    x: [0.6, 1.4, null, 1.6, 2.4, null, 2.6, 3.4],
    y: [65, 65, null, 20, 20, null, 50, 50],
    mode: 'lines'
}

That won't extend to categorical axes though (see also #2004) and I can see various other uses for markers that scale with the data axes, so it's definitely a feature worth considering.

@molehillrocker
Copy link
Author

In most charts we actually use numerical axes, so I think I'll try your approach, since it looks very promising. :)

@molehillrocker
Copy link
Author

I got it to work with the mentioned workaround, thanks a lot. Should I close this issue or do you want to keep it open as a feature request?

@alexcjohnson
Copy link
Collaborator

It's an interesting idea, not one we'll be working on in the near future but worth keeping open.

@alexcjohnson alexcjohnson added the feature something new label Nov 3, 2017
@alexcjohnson alexcjohnson changed the title Auto-scale symbol width based on width of x-coordinate in grouped bar charts Set marker size in data coordinates, not just pixels Nov 3, 2017
@gvwilson
Copy link
Contributor

Hi - this issue has been sitting for a while, so as part of our effort to tidy up our public repositories I'm going to close it. If it's still a concern, we'd be grateful if you could open a new issue (with a short reproducible example if appropriate) so that we can add it to our stack. Cheers - @gvwilson

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature something new
Projects
None yet
Development

No branches or pull requests

3 participants