Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 KB | None | 0 0
  1. <script type="text/javascript" src="<?php echo base_url('asset/js/charts/v_soaotc_daily.js')?>"></script>
  2.  
  3. $(function () {
  4.  
  5. $('#soaotc_daily_chart').highcharts({
  6. chart: {
  7. zoomType: 'xy'
  8. },
  9. title: {
  10. text: 'SOA_OTC Daily'
  11. },
  12. xAxis: [{
  13. categories: []
  14. }],
  15. yAxis: [{ // Primary yAxis
  16. labels: {
  17. // format: '{value} Rs.',
  18. style: {
  19. color: Highcharts.getOptions().colors[1]
  20. }
  21. },
  22. title: {
  23. text: 'Amount',
  24. style: {
  25. color: Highcharts.getOptions().colors[1]
  26. }
  27. }
  28. }, { // Secondary yAxis
  29. title: {
  30. text: 'Population',
  31. style: {
  32. color: Highcharts.getOptions().colors[0]
  33. }
  34. },
  35. labels: {
  36. //format: '{value} out of 100',
  37. style: {
  38. color: Highcharts.getOptions().colors[0]
  39. }
  40. },
  41. opposite: true
  42. }],
  43. tooltip: {
  44. shared: true
  45. },
  46. legend: {
  47. layout: 'vertical',
  48. align: 'left',
  49. x: 120,
  50. verticalAlign: 'top',
  51. y: 100,
  52. floating: true,
  53. backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'
  54. },
  55. series: [{
  56. name: 'Population',
  57. type: 'column',
  58. yAxis: 1,
  59. data: [],
  60. tooltip: {
  61. // valueSuffix: ' out of 100'
  62. },
  63. dataLabels: {
  64. enabled: true,
  65. // format: '{point.y:.0f}/100'
  66. }
  67.  
  68. }, {
  69. name: 'Amount',
  70. type: 'spline',
  71. data: [],
  72. tooltip: {
  73. valueSuffix: ''
  74. }
  75. }]
  76. }, function(theChart){
  77.  
  78. $.getJSON("<?php echo base_url(); ?>soaotc/daily_json", function(json) {
  79. alert('sukses');
  80. theChart.xAxis[0].setCategories(json[0]['data']);
  81. theChart.series[0].setData(json[1]['data'], false);
  82. theChart.series[1].setData(json[2]['data'], true);
  83.  
  84. })
  85. .fail( function(d, textStatus, error) {
  86. console.error("getJSON failed, status: " + textStatus + ", error: "+error)
  87. });
  88.  
  89. });
  90.  
  91. var theChart = $('#container').highcharts();
  92. });
  93.  
  94. getJSON failed, status: parsererror, error: SyntaxError: Unexpected token D
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement