Skip to content

Commit

Permalink
Added class for pie charts [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
ankane committed Feb 25, 2023
1 parent a5d7d85 commit 759d85e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 6 additions & 0 deletions app/assets/stylesheets/pghero/application.css
Original file line number Diff line number Diff line change
Expand Up @@ -485,6 +485,12 @@ body {
color: #999;
}

.pie-chart {
height: 260px;
line-height: 260px;
margin-bottom: 20px;
}

.unused-index {
color: #f0ad4e;
font-size: 11px;
Expand Down
6 changes: 3 additions & 3 deletions app/views/pg_hero/home/connections.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,22 @@
<% if @total_connections > 0 %>
<h3>By Database</h3>

<div id="chart-1" class="chart" style="height: 260px; line-height: 260px; margin-bottom: 20px;">Loading...</div>
<div id="chart-1" class="chart pie-chart">Loading...</div>
<script>
new Chartkick.PieChart("chart-1", <%= pghero_js_value(@connections_by_database) %>);
</script>

<h3>By User</h3>

<div id="chart-2" class="chart" style="height: 260px; line-height: 260px; margin-bottom: 20px;">Loading...</div>
<div id="chart-2" class="chart pie-chart">Loading...</div>
<script>
new Chartkick.PieChart("chart-2", <%= pghero_js_value(@connections_by_user) %>);
</script>

<% if @connections_by_ssl_status %>
<h3>By Security</h3>

<div id="chart-3" class="chart" style="height: 260px; line-height: 260px; margin-bottom: 20px;">Loading...</div>
<div id="chart-3" class="chart pie-chart">Loading...</div>
<script>
new Chartkick.PieChart("chart-3", <%= pghero_js_value(@connections_by_ssl_status) %>);
</script>
Expand Down

0 comments on commit 759d85e

Please sign in to comment.