Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $.ajax({
- url: base_url+'/dashboard/graph-booking-week',
- type: 'GET',
- async: true,
- dataType: "json",
- success: function (data) {
- var tgl = [];
- var graph = [];
- $.each(data, function(index, dataa){
- tgl.push(index);
- graph.push(dataa);
- });
- var detail = {
- container : 'container-week',
- title: 'Number of transactions per week',
- axisTitle: 'Date'
- }
- visitorData(detail,graph,tgl);
- }
- });
- function visitorData (detail,data,tgl) {
- Highcharts.chart(detail.container, {
- title: {
- text: detail.title
- },
- yAxis: {
- title: {
- text: 'Total transactions'
- }
- },
- xAxis: {
- categories:tgl,
- title: {
- text: detail.axisTitle
- }
- },
- legend: {
- layout: 'vertical',
- align: 'center',
- verticalAlign: 'bottom'
- },
- series: [{
- name: 'Booking',
- data: data
- }],
- });
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement