jQuery(function() { var analytics_data = {"labels" : ["04 02 26","04 03 26","04 04 26","04 05 26","04 06 26","04 07 26","04 08 26"], "datas" : ["0","0","1","0","0","0","0"]}; var show_legend = 0;
$show_ticks = true; if( jQuery(window).width() <= 640 ) { $show_ticks = false; } $placeholder_width = jQuery('.analytics-chart-placeholder').outerWidth(); if( $placeholder_width < 340 ) { $placeholder_width = 340; } jQuery('.analytics-chart-placeholder').css( 'width', $placeholder_width + 'px' ); var ctx = document.getElementById("analytics-chart-placeholder-canvas").getContext("2d"); var myLineChart = new Chart(ctx, { type: 'line', data: { labels: analytics_data.labels, datasets: [{ label: "Daily Views", backgroundColor: color(window.chartColors.orange).alpha(0.2).rgbString(), borderColor: window.chartColors.orange, fill: true, data: analytics_data.datas, }] }, options: { responsive: true, title:{ text: "Store Analytics", position: "bottom", }, legend: { position: "bottom", display: show_legend, }, scales: { xAxes: [{ type: "time", time: { format: timeFormat, round: 'day', tooltipFormat: 'll' }, scaleLabel: { display: false, labelString: 'Date' }, ticks:{ display: $show_ticks } }], yAxes: [{ scaleLabel: { display: false, labelString: 'Views' } }] }, } }); });

