Advertisement
Guest User

Untitled

a guest
Mar 18th, 2017
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.77 KB | None | 0 0
  1. $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function (data) {
  2.  
  3. Highcharts.chart('container', {
  4. chart: {
  5. zoomType: 'x'
  6. },
  7. title: {
  8. text: 'Visits on x'
  9. },
  10. subtitle: {
  11. text: document.ontouchstart === undefined ?
  12. 'Click and drag in the plot area to zoom in' : 'Pinch the chart to zoom in'
  13. },
  14. xAxis: {
  15. type: 'datetime'
  16. },
  17. yAxis: {
  18. title: {
  19. text: 'Visits'
  20. }
  21. },
  22. legend: {
  23. enabled: false
  24. },
  25. plotOptions: {
  26. area: {
  27. fillColor: {
  28. linearGradient: {
  29. x1: 0,
  30. y1: 0,
  31. x2: 0,
  32. y2: 1
  33. },
  34. stops: [
  35. [0, Highcharts.getOptions().colors[0]],
  36. [1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
  37. ]
  38. },
  39. marker: {
  40. radius: 2
  41. },
  42. lineWidth: 1,
  43. states: {
  44. hover: {
  45. lineWidth: 1
  46. }
  47. },
  48. threshold: null
  49. }
  50. },
  51.  
  52. series: [{
  53. type: 'area',
  54. name: 'Visits',
  55. data: data
  56. }]
  57. });
  58.  
  59. try
  60. {
  61. $pdo_options[PDO::ATTR_ERRMODE] = PDO::ERRMODE_EXCEPTION;
  62. $username = "dbname"; //DB USERNAME
  63. $password = "dbpw"; //DB PASSWORD
  64.  
  65. $datab = new PDO('mysql:host=127.0.0.1;dbname=db', $username, $password, $pdo_options);
  66. }
  67. catch (Exception $e)
  68. {
  69. echo "hiba: ".$e->getMessage();
  70. die();
  71. }
  72.  
  73.  
  74. $visits = $datab->prepare("SELECT * FROM views WHERE page ='index'");
  75. $visits->execute();
  76. $counter = $visits->fetch(PDO::FETCH_ASSOC);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement