Skip to content

Commit

Permalink
[PBNTR-277] fix Bar Graph axisTitle requirement (#3372)
Browse files Browse the repository at this point in the history
[PBNTR-277](https://nitro.powerhrg.com/runway/backlog_items/PBNTR-277)

This PR allows devs to not have to pass in the `axisTitle` prop.


**How to test?** Steps to confirm the desired behavior:
Pull to your local and removed a `axisTitle` prop and see if the graph
still loads


#### Checklist:
- [x] **LABELS** Add a label: `enhancement`, `bug`, `improvement`, `new
kit`, `deprecated`, or `breaking`. See [Changelog &
Labels](https://github.com/powerhome/playbook/wiki/Changelog-&-Labels)
for details.
- [x] **DEPLOY** I have added the `milano` label to show I'm ready for a
review.
- [ ] **TESTS** I have added test coverage to my code.
  • Loading branch information
nickamantia authored May 1, 2024
1 parent 230f569 commit 6f601d3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion playbook/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ const BarGraph = ({
max: yAxisMax,
opposite: false,
title: {
text: typeof axisTitle === 'string' ? axisTitle : axisTitle[0].name,
text: Array.isArray(axisTitle) ? (axisTitle.length > 0 ? axisTitle[0].name : null) : axisTitle,
},
plotLines: typeof yAxisMin !== 'undefined' && yAxisMin !== null ? [] : [{
value: 0,
Expand Down

0 comments on commit 6f601d3

Please # to comment.