<%= panel('Asset accessibility', type: 'panel-default dashboard-panel most-activity') do %>
  <canvas id="published-canvas"></canvas>
<% end %>

<% assets = @project ? @project.assets : Seek::Util.asset_types.map(&:all).flatten %>
<% published_count = assets.count { |a| a.is_published? } %>
<% private_count = assets.count { |a| a.private? } %>
<% misc_permissions = assets.count - (published_count + private_count) %>
<script>
    var publishedAssetsChart = new Chart(document.getElementById('published-canvas').getContext('2d'), {
            type: 'pie',
            data: {
                datasets: [{
                    data: [
                        <%= published_count %>,
                        <%= misc_permissions %>,
                        <%= private_count %>
                    ],
                    backgroundColor: [
                        '#a6ff6a',
                        '#ffe46e',
                        '#ff8a60'
                    ],
                    label: 'Dataset 1'
                }],
                labels: [
                    'Published',
                    'Restricted',
                    'Private'
                ]
            },
            options: {
                responsive: true
            }
        });
</script>

<%= panel('Asset accessibility', type: 'panel-default dashboard-panel') do %>
  <canvas id="published-canvas"></canvas>
<% end %>

<% assets = @project ? @project.assets : Seek::Util.asset_types.map(&:all).flatten %>
<% published_count = assets.count { |a| a.is_published? } %>
<% private_count = assets.count { |a| a.private? } %>
<% misc_permissions = assets.count - (published_count + private_count) %>
<script>
    var publishedAssetsChart = new Chart(document.getElementById('published-canvas').getContext('2d'), {
            type: 'pie',
            data: {
                datasets: [{
                    data: [
                        <%= published_count %>,
                        <%= misc_permissions %>,
                        <%= private_count %>
                    ],
                    backgroundColor: [
                        '#a6ff6a',
                        '#ffe46e',
                        '#ff8a60'
                    ],
                    label: 'Dataset 1'
                }],
                labels: [
                    'Published',
                    'Restricted',
                    'Private'
                ]
            },
            options: {
                responsive: true,
                legend: {
                    position: 'right'
                }
            }
        });
</script>

Move pie chart legend to the right
Move pie chart legend to the right
