-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[PLAY-1617] Change Bar Graph Override Example (#3982)
**What does this PR do?** A clear and concise description with your runway ticket url. Runway https://runway.powerhrg.com/backlog_items/PLAY-1617 Make visual updates to the bar graph doc example for custom overrides **How to test?** Steps to confirm the desired behavior: 1. Go to https://pr3982.playbook.beta.gm.powerapp.cloud/kits/bar_graph/react#custom-overrides 2. Look at how great the chart is 3. Rails too https://pr3982.playbook.beta.gm.powerapp.cloud/kits/bar_graph/rails#custom-overrides ![Screenshot 2024-12-13 at 8 27 41 AM](https://github.com/user-attachments/assets/8f782dee-4398-4874-af00-1b0de5c3d48d) --------- Co-authored-by: Gary Kang <[email protected]>
- Loading branch information
1 parent
b0bf1da
commit f07a662
Showing
2 changed files
with
82 additions
and
85 deletions.
There are no files selected for viewing
102 changes: 53 additions & 49 deletions
102
playbook/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 29 additions & 36 deletions
65
playbook/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,42 @@ | ||
<% data = [{ | ||
name: 'Installation', | ||
data: [1475,200,3000,654,656] | ||
name: 'Role', | ||
data: [0, 200, 300, 654, 656], | ||
}, { | ||
name: 'Manufacturing', | ||
data: [4434,524,2320,440,500] | ||
}, { | ||
name: 'Sales & Distribution', | ||
data: [3387,743,1344,434,440,] | ||
}, { | ||
name: 'Project Development', | ||
data: [3227,878,999,780,1000] | ||
}, { | ||
name: 'Other', | ||
data: [1111,677,3245,500,200] | ||
name: 'Company', | ||
data: [150, 524, 320, 440, 500], | ||
}] %> | ||
|
||
<% bar_graph_options = { | ||
customOptions: { | ||
subtitle: { | ||
text: "Overwritten subtitle", | ||
style: { | ||
color: "red" | ||
} | ||
customOptions: { | ||
yAxis: { | ||
tickInterval: 5, | ||
}, | ||
xAxis: { | ||
categories: [ | ||
raw(pb_rails("icon", props: { icon: "frown", color: "error", size: "2x" })), | ||
raw(pb_rails("icon", props: { icon: "frown", color: "warning", size: "2x" })), | ||
raw(pb_rails("icon", props: { icon: "frown-open", color: "neutral", size: "2x" })), | ||
raw(pb_rails("icon", props: { icon: "smile", color: "category_7", size: "2x" })), | ||
raw(pb_rails("icon", props: { icon: "smile-beam", color: "success", size: "2x" })) | ||
], | ||
labels: { | ||
useHTML: true, | ||
sytle: { | ||
fontSize: '1.4em', | ||
}, | ||
xAxis: { | ||
categories: [ | ||
'<i class="far fa-apple-whole"></i> Jan', | ||
'<i class="far fa-strawberry"></i> Feb', | ||
'<i class="far fa-lemon"></i> Mar', | ||
'<i class="far fa-pear"></i> Apr', | ||
'<i class="far fa-peach"></i> May' | ||
], | ||
labels: { | ||
useHTML: true, | ||
} | ||
} | ||
} | ||
y: 42, | ||
}, | ||
}, | ||
legend: { | ||
itemMarginTop: 62, | ||
}, | ||
} | ||
} %> | ||
|
||
<%= pb_rails("bar_graph", props: { | ||
axis_title: 'Number of Employees', | ||
chart_data: data, | ||
id: "bar-default", | ||
y_axis_min: 0, | ||
subtitle: 'Subtitle to replace', | ||
legend: true, | ||
title: 'Bar Graph with Custom Overrides', | ||
custom_options: bar_graph_options | ||
}) %> | ||
}) %> |