ChartsOrg / ChartsOrg/Charts

Barchart unequal width of bars

Open
#4,389 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
28k
Forks
6k
PR merge metrics
No merged PRs in 30d

Description

When using the code

```
chart.backgroundColor = UIColor.white
chart.xAxis.enabled = false
chart.leftAxis.enabled = false
chart.rightAxis.enabled = false
chart.drawBordersEnabled = false
chart.minOffset = 10
chart.legend.enabled = false
chart.isUserInteractionEnabled = false
```

the bars on the sides (i.e. the most left and the most right bar) are smaller than the rest (see attached screenshot).

Any idea how to fix this?

The values start at x:10 and go to x:70 in steps of 10, the width of the bar is defined as
```
let data = BarChartData(dataSet: setData)
data.barWidth = 2.5
```

![IMG_5227](https://user-images.githubusercontent.com/9201403/84069290-99614c80-a9ca-11ea-8292-a42c3c2039a6.jpg)

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is named. Reproduce the issue with the supplied Swift chart configuration, x values from 10 to 70, and barWidth of 2.5, then trace the bar rendering and axis-range behavior. Done means the first and last bars have the same apparent width as the others.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
data-visualization, mobile-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.