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

Add a way to put the label inside the Chart instead of outside #51

Closed
grillorafael opened this issue Dec 8, 2015 · 3 comments
Closed

Comments

@grillorafael
Copy link

I can do it with CSS only but then the label is below the chart.

image

@grillorafael grillorafael changed the title Add a way to put the label inside the co Add a way to put the label inside the Chart instead of outside Dec 8, 2015
@jpetitcolas
Copy link
Contributor

How did you do it with CSS?

I don't think that's a use case we need to support, as it is quite specific. However, for narrow spaces, we may perhaps add an option to disable labels? Then, in this case, you would be able to add them back using pure CSS, and playing with element z-indexes?

@grillorafael
Copy link
Author

Hey @jpetitcolas I don't remember exactly but I think I removed the margin and maybe changed the text-anchor.

But since the time I opened this issue I really improved my knowledge on D3 so I think I'll try to open a PR for this.

About the css z-index, it didn't work because the z-index was defined by the order of elements on SVG.

About the use case, I think it is nice to support because it fits better when adding the chart to some sort of box.

@jpetitcolas
Copy link
Contributor

A PR has been created to put labels over the drops (#234). Then, using some negative label padding, you should be able to put labels inside your chart (at least on version 1.1.x):

const chart = eventDrops({
    label: {
        padding: -200,
    },
};

@jpetitcolas jpetitcolas self-assigned this Mar 21, 2018
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

2 participants