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

Padding for text label of extralines #824

Open
beerline opened this issue Nov 22, 2021 · 11 comments
Open

Padding for text label of extralines #824

beerline opened this issue Nov 22, 2021 · 11 comments
Labels
enhancement New feature or request good first issue Good for newcomers Line Chart

Comments

@beerline
Copy link

Hello and thank u for great chart library!

It would be nice to have padding around text, because for now for make text look nicer we have to use spaces on both sides of text.

Example (with padding):
Screenshot 2021-11-22 at 21 53 04

Example (how it works now):
Screenshot 2021-11-22 at 21 52 46

THank you for your help!

@imaNNeo
Copy link
Owner

imaNNeo commented Jan 30, 2023

You can use tooltipPadding property in the LineTouchTooltipData.

@imaNNeo imaNNeo added question Further information is requested Line Chart labels Jan 30, 2023
@imaNNeo imaNNeo closed this as completed Jan 30, 2023
@beerline
Copy link
Author

beerline commented Jan 31, 2023

@imaNNeo thank u for your response.
Sorry if my question wasn't clear from the beginning.

Purple line on screenshots above is VerticalLine. And VerticalLine hasn't paddings. Same as HorizontalLine

@imaNNeo
Copy link
Owner

imaNNeo commented Jan 31, 2023

So you want to render a text with some padding around it?

@beerline
Copy link
Author

beerline commented Feb 1, 2023

yes, i want to render a text with some padding around it

@imaNNeo
Copy link
Owner

imaNNeo commented Feb 2, 2023

There is a padding property in the VerticalLineLabel. Does it help?

@beerline
Copy link
Author

beerline commented Feb 6, 2023

@imaNNeo thank u for your suggest solution.
VerticalLineLabel.padding add padding to whole label.

Example:

HorizontalLineLabel.padding = EdgeInsets.zero

Screenshot 2023-02-06 at 11 28 56

HorizontalLineLabel.padding = EdgeInsets.symmetric(horizontal: 5)

Screenshot 2023-02-06 at 11 28 11

I am looking for padding for text inside label. So it would be nice looking color frame around text.

Example:

text with padding

Screenshot 2023-02-06 at 11 35 24

text without padding

Screenshot 2023-02-06 at 11 35 53

@imaNNeo
Copy link
Owner

imaNNeo commented Feb 8, 2023

Got it. It works as a margin (we should rename it to margin). Then we can add a padding field which works correctly.

@imaNNeo imaNNeo reopened this Feb 8, 2023
@imaNNeo imaNNeo added enhancement New feature or request good first issue Good for newcomers and removed question Further information is requested labels Feb 8, 2023
@fabiototh
Copy link

@imaNNeo VerticalLineLabel -> labelResolver, return only String. Why not a Widget? For example, I would like to put an icon.

@imaNNeo
Copy link
Owner

imaNNeo commented Jun 14, 2023

@imaNNeo VerticalLineLabel -> labelResolver, return only String. Why not a Widget? For example, I would like to put an icon.

Because having widgets inside the chart is not as easy at it seems

@k0psutin
Copy link
Contributor

@imaNNeo I could take a look at this. We could add margin/padding for all of the chart tooltips as well?

@imaNNeo
Copy link
Owner

imaNNeo commented Nov 24, 2023

take a look at this. We could add margin/padding for all of the cha

Hi @k0psutin, Yes exactly. We can have padding/margin for everything

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Line Chart
Projects
None yet
Development

No branches or pull requests

4 participants