axisNameWidget not centered based on axis/chart height
- Dominant language
- Dart
- Stars
- 7.6k
- Forks
- 2k
- Avg merge
- 9d 1h
- Merged PRs (30d)
- 2
Description
I am using a simple bar chart with a `leftTitles` configuration that includes an `axisNameWidget`.
The title configuration is as follows:
```
AxisTitles(
axisNameWidget: Text(
axisTitle,
style: axisTitleTextStyle,
),
...
)
```
**Expected Behavior:**
I expected the axisNameWidget (the axis name) to be centered relative to the axis/chart height.
**Actual Behavior:**
The axisNameWidget is centered based on the full chart height, which includes:
- The chart itself
- Bottom side titles
- Bottom axis name
As a result, the axis title (as shown in the screenshot) is positioned between the values 20-40, whereas the expected position is between 40-60 (center of the chart).
EDIT: The same issue occurs on the other axis where the title "Months" is positioned between March and April. However, since the center label is April, the expected title position should be directly below April.
**Screenshot:**

Contributor guide
Research direction
Start by reproducing the simple bar chart with leftTitles and axisNameWidget, then trace how AxisTitles lays out the axis title relative to the chart and surrounding titles. Confirm the current centering behavior on both axes; done means each axis name is centered over the plotted chart area rather than the full widget height.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- dart, flutter
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100