Immediate-Mode-UI / Immediate-Mode-UI/Nuklear

Why are there small deviations in gaps between drawn columns in charts?

Open
#449 8 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
11.4k
Forks
686
Avg merge
4d 1h
Merged PRs (30d)
3

Description

Consider:

```
...
#define WINDOW_WIDTH 800
#define WINDOW_HEIGHT 600
...
```

```
...
if (nk_begin(ctx, "BareMusic", nk_rect(0, 0, WINDOW_WIDTH, WINDOW_HEIGHT),
NK_WINDOW_BORDER|NK_WINDOW_NO_SCROLLBAR|NK_WINDOW_TITLE))
{
nk_layout_row_dynamic(ctx, 100, 1);
if (nk_group_begin(ctx, "1", NK_WINDOW_BORDER | NK_WINDOW_NO_SCROLLBAR)) {
nk_group_end(ctx);
}
/* IMAGE HAS THE RESULT OF FOLLOWING */
if (nk_chart_begin(ctx,NK_CHART_COLUMN,16,0,4))
{
int i;
for (i = 0; i < 16; ++i)
nk_chart_push(ctx, 4);
nk_chart_end(ctx);
}

}
nk_end(ctx);
...
```

Result is:

![Screenshot_2022-04-18_19-35-42](https://user-images.githubusercontent.com/1913544/164412817-294ef851-aacf-4d35-84f6-933f524c515c.png)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the nk_chart_begin, nk_chart_push, and nk_chart_end calls shown in the report, then reproduce the 16-column example using the stated 800×600 window. Determine whether the uneven gaps are expected or indicate a chart-rendering defect; done requires a clear explanation or a reproducible correction validated against this example.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
data-visualization, frontend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.