question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Edit gridlines width + make uplot fill whole parent div

See original GitHub issue

Hello,

Is there a way to edit the colour and width of the background gridlines of a plot (see image)?

Additional, any solution for making uplot fill the whole containing div? I cannot make my plot ‘flush’ with an item on the same y-height (outside of picture). I’ve tried to modify the css properties of u-under and u-over but to no success…

Untitled

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
leeoniyacommented, Oct 21, 2020

Is there a way to edit the colour and width of the background gridlines of a plot (see image)?

yes:

https://github.com/leeoniya/uPlot/blob/936c9b242a8e006707b239a6386e7814e13534f7/dist/uPlot.d.ts#L474-L490

Additional, any solution for making uplot fill the whole containing div? I cannot make my plot ‘flush’ with an item on the same y-height (outside of picture). I’ve tried to modify the css properties of u-under and u-over but to no success…

you can adjust the gutters or axis.size, but you’re more likely to end up with cut-off labels during zooming. for a static chart it’s probably okay.

https://github.com/leeoniya/uPlot/blob/936c9b242a8e006707b239a6386e7814e13534f7/dist/uPlot.d.ts#L179-L183

https://github.com/leeoniya/uPlot/blob/936c9b242a8e006707b239a6386e7814e13534f7/dist/uPlot.d.ts#L435-L436

you might also consider adding a box-shadow to better visually align the edges:

.uplot {
  box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.3);
}
0reactions
happytequecommented, Jan 31, 2021

Brilliant, that does it, thanks!

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to make CSS width to fill parent? - Stack Overflow
This way the table takes up the parent div 100%, and #barWrap is used to add borders/margin/padding to the #bar table. Note that...
Read more >
How can I make a chart fill its parent div · Issue #72 - GitHub
When I set no height/width, it seems to default too an arbitrary w/h. I want to only control the parent div's w/h so...
Read more >
How to Make a Div Fill the Remaining Width - W3docs
In this snippet, we're going to demonstrate some ways of making a expand to fill the remaining width. You can use the float...
Read more >
Define grid element height and width - OpenClassrooms
Set element measurements. To define on which grid lines an element should start and end, use the following properties: grid-column-start.
Read more >
How to Build Web Form Layouts With CSS Grid
The first step is to define our grid on the parent element form : ... the textarea and send button, and then make...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found