visitors_jqplot.html.twig in Visitors 8.2
<div id="visitors_chart" style="width: {{ width }}px; height: {{ height }}px;"></div>
{{ attach_library('visitors/jqplot.pointLabels') }}
{{ attach_library('visitors/jqplot.categoryAxisRenderer') }}
{{ attach_library('visitors/jqplot.barRenderer') }}
{{ attach_library('visitors/jquery.jqplot') }}
<script type="text/javascript">
jQuery(document).ready(function($){
var s = [{{ y | raw }}];
var ticks = [{{ x | raw }}];
$.jqplot('visitors_chart', [s], {
width: {{ width }},
height: {{ height }},
seriesDefaults: {
renderer: $.jqplot.BarRenderer,
pointLabels: { show: true }
},
axes: {
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer,
ticks: ticks
}
}
});
});
</script>
File
templates/visitors_jqplot.html.twig
View source
- <div id="visitors_chart" style="width: {{ width }}px; height: {{ height }}px;"></div>
-
-
-
- {{ attach_library('visitors/jqplot.pointLabels') }}
- {{ attach_library('visitors/jqplot.categoryAxisRenderer') }}
- {{ attach_library('visitors/jqplot.barRenderer') }}
- {{ attach_library('visitors/jquery.jqplot') }}
-
- <script type="text/javascript">
- jQuery(document).ready(function($){
- var s = [{{ y | raw }}];
- var ticks = [{{ x | raw }}];
-
- $.jqplot('visitors_chart', [s], {
- width: {{ width }},
- height: {{ height }},
- seriesDefaults: {
- renderer: $.jqplot.BarRenderer,
- pointLabels: { show: true }
- },
- axes: {
- xaxis: {
- renderer: $.jqplot.CategoryAxisRenderer,
- ticks: ticks
- }
- }
- });
- });
- </script>
-