美元兑主要国家汇率
表
微信
Loading...
确定
美元兑主要国家汇率
更新频率:daily
var table = $('#container').DataTable({ data: data0, pageLength: 100, columns:[ { className: 'details-control all', orderable: false, data: null, defaultContent: '', }, {// col0 data: 'SEC_NAME', title: '名称', className: 'all text-left', }, {// col1 data: 'DT', title: '日期', render: function(data, type, row, meta){ return new Date(data).toLocaleDateString(); }, className: 'all text-left', }, {// col3 data: 'CLOSE', title: '收盘价', type: 'html-num-fmt', render: function(data, type, row, meta){ return data === '-' ? '-' : Math.round(data * 100)/100; }, className: "all text-center", }, {// col3 data: 'cng', title: '涨跌幅', type: 'html-num-fmt', render: function(data, type, row, meta){ var d = data === '-' ? '-' : Math.round(data * 100)/100; return '
' + d + '%
'; }, className: "all text-center", }, {// col3 data: 'cng5', title: '涨跌幅(5日)', type: 'html-num-fmt', render: function(data, type, row, meta){ var d = data === '-' ? '-' : Math.round(data * 100)/100; return '
' + d + '%
'; }, className: "all text-center", }, {// col3 data: 'comp15', title: '趋势(超短期)', type: 'html-num-fmt', render: function(data, type, row, meta){ var d = data === '-' ? '-' : Math.round(data * 100)/100; if (d === 1){ console.log(d); return '
100%
'; } else if (d === -1){ return '
-100%
'; } else { return '
' + d*100 + '%
'; }}, className: "all text-center", }, {// col6 data: 'comp520', title: '趋势(短期)', type: 'html-num-fmt', render: function(data, type, row, meta){ var d = data === '-' ? '-' : Math.round(data * 100)/100; if (d === 1){ console.log(d); return '
100%
'; } else if (d === -1){ return '
-100%
'; } else { return '
' + d*100 + '%
'; }}, className: "all text-center", }, {// col7 data: 'comp2060', title: '趋势(中期)', type: 'html-num-fmt', render: function(data, type, row, meta){ var d = data === '-' ? '-' : Math.round(data * 100)/100; if (d === 1){ console.log(d); return '
100%
'; } else if (d === -1){ return '
-100%
'; } else { return '
' + d*100 + '%
'; }}, className: "all text-center", }, {// col9 data: 'quantile', title: '历史分位', render: function(data, type, row, meta){ return data === '-' ? '-' : Math.round(data * 100)/100 + '%'; }, className: "all text-center", }, /* {// col9 data: 'cngg2', title: '190225-至今', render: function(data, type, row, meta){ var d = data === '-' ? '-' : Math.round(data * 100)/100; return '
' + d + '%
'; }, className: "all text-center", }, {// col8 data: 'cngg1', title: '181224-190225', type: 'num-fmt', render: function(data, type, row, meta){ var d = data === '-' ? '-' : Math.round(data * 100)/100; return '
' + d + '%
'; }, className: "all text-center" }, */ { orderable: true, data: 'LEVEL', defaultContent: '', visible: false, }, ], language: { emptyTable: "未请求到数据。", info: "当前页面第_PAGE_页 共_PAGES_页", infoEmpty: "当前页面第1页 共1页", paginate: { first: '«', previous: '‹', next: '›', last: '»' }, aria: { paginate: { first: '首页', previous: '上一页', next: '下一页', last: '尾页' } }, zeroRecords: "没有找到数据。", infoFiltered: "(从全部_MAX_个数据中筛选出)", }, order: [[10, 'asc']], scrollX: false, autoWidth: false, dom: 't', }); var minWidth = 10; // $('#container').DataTable().columns().every(function(){if(this.visible()){minWidth += 1}}); minWidth *= 5; $('.main-container .dataTables_wrapper').css('min-width', minWidth + 'em'); /* Formatting function for row details - modify as you need */ $.fn.format = function( row ) { var $this = $(this), trade_code = row.data().TRADE_CODE, sec_name = row.data().SEC_NAME, code = trade_code.split('.')[0] query = [ "SELECT DT AS x,CLOSE AS 'y' FROM globalcurrency WHERE TRADE_CODE = '" + trade_code + "' AND CLOSE != 0 AND DT >= '2000-01-01'", ]; if( trade_code === $this.attr('data-code')){ return $this[0] } $this.attr('data-code', trade_code).empty(); $this.highcharts('StockChart', { rangeSelector: { enabled: false, inputEnabled:false, allButtonsEnabled:false, }, credits: { enabled: false, }, exporting: { enabled: false, }, scrollbar:{ enabled: false }, navigation: { menuItemStyle: { fontSize: '10px' } } }); $this.highcharts().showLoading(); $.ajax({ url: '/element/run/query/', data: { query: JSON.stringify(query), queryLanguage: 0, dateFormat: 'timestamp', output: 'records', na: 'drop', }, success: function(res){ res = res.data; $this.highcharts().hideLoading(); $this.highcharts('StockChart', { chart: { type:'line', }, subtitle: { text: sec_name, }, yAxis: [{ }], legend: { enabled: true, }, series: [{ data: res[0].table, name: '收盘价', zIndex: 1, }], rangeSelector: { selected: 1, }, exporting: { enabled: true, buttons: { customButton: { text: '关闭', onclick: function () { $('.table-chart').css({'z-index': -1, display: 'none'}); } }, contextButton: { enabled: false, } } } }); } }); }