Guest User

Untitled

a guest
Jan 19th, 2018
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.61 KB | None | 0 0
  1. $.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function (data) {
  2. // Create the chart
  3. Highcharts.stockChart('container', {
  4.  
  5. chart: {
  6. height: 300
  7. },
  8.  
  9. rangeSelector: {
  10. allButtonsEnabled: true,
  11. buttons: [{
  12. type: 'month',
  13. count: 3,
  14. text: 'Day',
  15. dataGrouping: {
  16. forced: true,
  17. units: [['day', [1]]]
  18. }
  19. }, {
  20. type: 'year',
  21. count: 1,
  22. text: 'Week',
  23. dataGrouping: {
  24. forced: true,
  25. units: [['week', [1]]]
  26. }
  27. }, {
  28. type: 'all',
  29. text: 'Month',
  30. dataGrouping: {
  31. forced: true,
  32. units: [['month', [1]]]
  33. }
  34. }],
  35. buttonTheme: {
  36. width: 60
  37. },
  38. selected: 2
  39. },
  40.  
  41. title: {
  42. text: 'AAPL Stock Price'
  43. },
  44.  
  45. subtitle: {
  46. text: 'Custom data grouping tied to range selector'
  47. },
  48.  
  49. _navigator: {
  50. enabled: false
  51. },
  52.  
  53. series: [{
  54. name: 'AAPL',
  55. data: data,
  56. marker: {
  57. enabled: null, // auto
  58. radius: 3,
  59. lineWidth: 1,
  60. lineColor: '#FFFFFF'
  61. },
  62. tooltip: {
  63. valueDecimals: 2
  64. }
  65. }]
  66. });
  67. });
Add Comment
Please, Sign In to add comment