$(function() { "use strict"; // ============================================================== // Newsletter // ============================================================== var chart = new Chartist.Line('.total-revenue4', { labels: ['ม.ค.','ก.พ','มี.ค','เม.ย','พ.ค','มิ.ย','ก.ค','ส.ค','ก.ย','ต.ค','พ.ย','ธ.ค'], series: [ [0.7101395,0.7918664,0.7445292,0.7750689,1.1056493,1.2810026,1.310674,2.5537036,2.1639909,1.3588452,1.4952197,1.2304744,], [1.2286675,0,0,0,0,0,0,0,0,0,0,0,] ] }, { low: 0, high: 3, showArea: true, fullWidth: true, plugins: [ Chartist.plugins.tooltip() ], axisY: { onlyInteger: true, scaleMinSpace: 60, offset: 50, labelInterpolationFnc: function(value) { return (value / 1) + ' ล้าน'; } }, }); // Offset x1 a tiny amount so that the straight stroke gets a bounding box // Straight lines don't get a bounding box // Last remark on -> http://www.w3.org/TR/SVG11/coords.html#ObjectBoundingBox chart.on('draw', function(ctx) { if (ctx.type === 'area') { ctx.element.attr({ x1: ctx.x1 + 0.001 }); } }); }); // Sky Icons var icons = new Skycons({ "color": "#ff6849" }) , list = [ "clear-day", "clear-night", "partly-cloudy-day" , "partly-cloudy-night", "cloudy", "rain", "sleet", "snow", "wind" , "fog" ] , i; for (i = list.length; i--;) { var weatherType = list[i] , elements = document.getElementsByClassName(weatherType); for (e = elements.length; e--;) { icons.set(elements[e], weatherType); } } icons.play();