Advertisement
Guest User

chart.js

a guest
Jul 18th, 2015
219
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(function () {
  2.     $('#chart').on( 'click',function() {
  3.  
  4.         $.ajax({
  5.             url: '/api/chart/ticket/classification',
  6.             data_type: 'json',
  7.             success: function(json){
  8.                         $('#plotagem').highcharts({
  9.                     chart: {
  10.                         type: 'column'
  11.                     },
  12.                     title: {
  13.                         text: 'Atendimentos Realizados por Fila'
  14.                     },
  15.                     xAxis: {
  16.                         type: 'category'
  17.                     },
  18.                     yAxis: {
  19.                         title: {
  20.                             text: 'Total percent market share'
  21.                         }
  22.  
  23.                     },
  24.                     legend: {
  25.                         enabled: false
  26.                     },
  27.                     plotOptions: {
  28.                         series: {
  29.                             borderWidth: 0,
  30.                             dataLabels: {
  31.                                 enabled: true,
  32.                                 format: '{point.y:.1f}%'
  33.                             }
  34.                         }
  35.                     },
  36.  
  37.                     tooltip: {
  38.                         headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
  39.                         pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
  40.                     },
  41.  
  42.                     series: [{
  43.                         name: "Brands",
  44.                         colorByPoint: true,
  45.                         data: json
  46.                     }],
  47.                 });
  48.             },
  49.             error: function() {
  50.                 alert("Error");
  51.             }
  52.          
  53.         });
  54.         return false;
  55.     });
  56. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement