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.

Bug: Column thickness and spacing changes depending on the data count

See original GitHub issue

This is the preview I get from Jetpack Compose, you can see that the more the data displayed, the smaller the column is.

image

Expected behavior Column thickness and spacing should be consistent regardless of how much data is displayed, if the data is too much to display in the screen, then it should be horizontally scrollable.

Code:

Chart(
    chart = columnChart(
        columns = listOf(
            LineComponent(context.getColor(R.color.primary), 1f, shape = pillShape),
            LineComponent(context.getColor(R.color.secondary), 1f, shape = pillShape),
        ),
        dataLabel = textComponent {
            typeface = Typeface.SANS_SERIF
            textAlign = Paint.Align.CENTER
            color = android.graphics.Color.WHITE
        },
        dataLabelVerticalPosition = VerticalPosition.Bottom,
        spacing = 4.dp,
        innerSpacing = 0.1.dp
    ),
    model = entryModelOf(frequencies, remainingStocks),
    startAxis = startAxis(
        label = axisLabelComponent(typeface = Typeface.SANS_SERIF, textSize = 10.sp, lineCount = 1),
        axis = null,
        tick = null,
        guideline = axisGuidelineComponent(shape = Shapes.rectShape, color = Color.LightGray.copy(alpha = .25f)),
        valueFormatter = DecimalFormatAxisValueFormatter("##")
    ),
    bottomAxis = bottomAxis(
        label = axisLabelComponent(typeface = Typeface.SANS_SERIF, textSize = 10.sp, lineCount = 1),
        guideline = null,
        tick = null,
        axis = null,
        valueFormatter = { value, _ -> labels[value.roundToInt()] }
    ),
)

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
ghostcommented, Dec 2, 2022

Hello! Vico 1.6.0, which is now rolling out, adds the feature in question. Thank you for the suggestion!

1reaction
ghostcommented, Nov 22, 2022

I’ll add the parameter in question as soon as possible. Regarding thicknessDp, it’s not so much the minimum width as it is the intrinsic width. It’s multiplied by thicknessScale in the draw* functions of LineComponent. The factor can be greater than 1, equal to 1, or smaller than 1. We’ll discuss renaming the field to intrinsicWidth. Cheers for the context and the suggestion!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Handling content breaks in multi-column layout - CSS
Content is broken between column boxes in multi-column layout in the same way that it is broken between pages in paged media.
Read more >
Is There any way to fix Column Widths in a Matrix
Solved: In a Matrix visualization, is there any way to fix the column widths so they don't change. Specifically, I have a matrix...
Read more >
How to change and AutoFit column width in Excel - Ablebits
Learn a few efficient ways to change Excel column width manually and have it adjusted automatically to fit the contents (AutoFit columns).
Read more >
Column Sizing - JavaScript Data Grid
Auto-Size Columns · The grid works out the best width by considering the virtually rendered rows only. · Autosizing columns looks at the...
Read more >
3.6 Adjusting Bar Width and Spacing - R Graphics Cookbook
You want to adjust the width of bars and the spacing between them. ... library(gcookbook) # Load gcookbook for the pg_mean data set...
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