forked from Aspen-Discovery/aspen-discovery
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #91 from Chloe070196/ils_usage_graphs
feat: ILS usage graphs
- Loading branch information
Showing
4 changed files
with
376 additions
and
14 deletions.
There are no files selected for viewing
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
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 |
---|---|---|
@@ -0,0 +1,85 @@ | ||
{strip} | ||
<div id="main-content" class="col-sm-12"> | ||
<h1>{translate text=$graphTitle isAdminFacing=true}</h1> | ||
<div class="chart-container" style="position: relative; height:50%; width:100%"> | ||
<canvas id="chart"></canvas> | ||
</div> | ||
|
||
<h2>{translate text="Raw Data" isAdminFacing=true}</h2> | ||
<div class="adminTableRegion fixed-height-table"> | ||
<table class="adminTable table table-responsive table-striped table-bordered table-condensed smallText table-sticky"> | ||
<thead> | ||
<tr> | ||
<th>{translate text="Date" isAdminFacing=true}</th> | ||
{foreach from=$dataSeries key=seriesLabel item=seriesData} | ||
<th>{if !empty($translateDataSeries)}{translate text=$seriesLabel isAdminFacing=true}{else}{$seriesLabel}{/if}</th> | ||
{/foreach} | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{foreach from=$columnLabels item=label} | ||
<tr> | ||
<td>{if !empty($translateColumnLabels)}{translate text=$label isAdminFacing=true}{else}{$label}{/if}</td> | ||
{foreach from=$dataSeries item=seriesData} | ||
<td>{if (empty($seriesData.data.$label))}0{else}{$seriesData.data.$label|number_format}{/if}</td> | ||
{/foreach} | ||
</tr> | ||
{/foreach} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
{/strip} | ||
{literal} | ||
<script> | ||
var ctx = document.getElementById('chart'); | ||
var myChart = new Chart(ctx, { | ||
type: 'line', | ||
data: { | ||
labels: [ | ||
{/literal} | ||
{foreach from=$columnLabels item=columnLabel} | ||
'{$columnLabel}', | ||
{/foreach} | ||
{literal} | ||
], | ||
datasets: [ | ||
{/literal} | ||
{foreach from=$dataSeries key=seriesLabel item=seriesData} | ||
{ldelim} | ||
label: "{translate text=$seriesLabel isAdminFacing=true}", | ||
data: [ | ||
{foreach from=$seriesData.data item=curValue} | ||
{$curValue}, | ||
{/foreach} | ||
], | ||
borderWidth: 1, | ||
borderColor: '{$seriesData.borderColor}', | ||
backgroundColor: '{$seriesData.backgroundColor}', | ||
{rdelim}, | ||
{/foreach} | ||
{literal} | ||
] | ||
}, | ||
options: { | ||
scales: { | ||
yAxes: [{ | ||
ticks: { | ||
beginAtZero: true | ||
} | ||
}], | ||
xAxes: [{ | ||
type: 'category', | ||
labels: [ | ||
{/literal} | ||
{foreach from=$columnLabels item=columnLabel} | ||
'{$columnLabel}', | ||
{/foreach} | ||
{literal} | ||
] | ||
}] | ||
} | ||
} | ||
}); | ||
</script> | ||
{/literal} |
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
Oops, something went wrong.