infobox-5.js 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. $(function () {
  2. initCounters();
  3. initCharts();
  4. });
  5. //Widgets count plugin
  6. function initCounters() {
  7. $('.count-to').countTo();
  8. }
  9. //Charts
  10. function initCharts() {
  11. //Chart Bar
  12. $.each($('.chart.chart-bar'), function (i, key) {
  13. var chartColor = $.AdminBSB.options.colors[$(key).data('chartcolor')];
  14. $(key).sparkline(undefined, {
  15. type: 'bar',
  16. barColor: chartColor,
  17. negBarColor: chartColor,
  18. barWidth: '8px',
  19. height: '34px'
  20. });
  21. });
  22. //Chart Pie
  23. $.each($('.chart.chart-pie'), function (i, key) {
  24. var chartColor = $.AdminBSB.options.colors[$(key).data('chartcolor')];
  25. $(key).sparkline(undefined, {
  26. type: 'pie',
  27. height: '50px',
  28. sliceColors: [hexToRgba(chartColor, '0.55'), hexToRgba(chartColor, '0.70'), hexToRgba(chartColor, '0.85'), hexToRgba(chartColor, '1')]
  29. });
  30. });
  31. //Chart Line
  32. $.each($('.chart.chart-line'), function (i, key) {
  33. var chartColor = $.AdminBSB.options.colors[$(key).data('chartcolor')];
  34. $(key).sparkline(undefined, {
  35. type: 'line',
  36. width: '60px',
  37. height: '45px',
  38. lineColor: chartColor,
  39. lineWidth: 1.3,
  40. fillColor: 'rgba(0,0,0,0)',
  41. spotColor: chartColor,
  42. maxSpotColor: chartColor,
  43. minSpotColor: chartColor,
  44. spotRadius: 3,
  45. highlightSpotColor: chartColor
  46. });
  47. });
  48. }