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

Scatter Plot legend highlight removes symbol type and size from plot #874

Closed
LorenzGardner opened this issue Mar 4, 2015 · 2 comments
Closed
Milestone

Comments

@LorenzGardner
Copy link

There is an issue with the legend highlight for scatter plots in a composite chart.

Many of these are generated when highlighting happens):

Error: Invalid value for attribute d="M-3.3541018589184217,-1.118033862702474A-1.118033862702474,-3.3541017686480883 1.1180339529728074 -1.1180339209728074,3.3541018909184217 1.1180339529728074,1.118033862702474A3.354101949188755,-1.118033862702474 1.1180339529728074 -3.3541018269184217,1 0,2.8209479177387813Z"
Clearly incorrect syntax, but I'm not sure where it is coming from as the stack trace shows only d3.min.js

Looks like it is trying to draw the symbol in one move cmd?

The correct data is highlighted, however the point symbol is removed. No longer a "cross"/"dimond"/ect ... and the symbol size is also reverted..

I'm guessing the highlight code makes an assumption that is not true in the scatter plot case.

@gordonwoodhull gordonwoodhull added this to the v2.0 milestone Mar 20, 2015
@gordonwoodhull
Copy link
Contributor

I've been investigating this in the context of this question:

https://stackoverflow.com/questions/44843726/how-to-use-scatter-chart-with-complex-data

In the fiddle, one of the series changes from circle to cross when its legend is hovered.

Curiously, this does not happen in the scatter series example, so perhaps there is something in the series chart that mitigates a bug in the straight composite chart?

@gordonwoodhull
Copy link
Contributor

The legend highlight functions in the scatter plot were using too broad of selectors, selecting all symbols regardless of whether they belonged to the same chart.

It might be considered a bug in chart.selectAll() that it is unaware of the child gs of composite charts; or it might be bad advice 😞 to use chart.selectAll() since it selects at the root div level.

In any case, this can be fixed by using _chart.chartBodyG().selectAll() instead of _chart.selectAll() in the legend highlighting functions.

Fixed in dc.js 2.0.5 / 2.1.8.

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

No branches or pull requests

2 participants