aboutsummaryrefslogtreecommitdiffstats
path: root/97suifangqa/apps/indicator/static/javascripts/load_card.js
diff options
context:
space:
mode:
Diffstat (limited to '97suifangqa/apps/indicator/static/javascripts/load_card.js')
-rw-r--r--97suifangqa/apps/indicator/static/javascripts/load_card.js107
1 files changed, 69 insertions, 38 deletions
diff --git a/97suifangqa/apps/indicator/static/javascripts/load_card.js b/97suifangqa/apps/indicator/static/javascripts/load_card.js
index 4db48a4..160273b 100644
--- a/97suifangqa/apps/indicator/static/javascripts/load_card.js
+++ b/97suifangqa/apps/indicator/static/javascripts/load_card.js
@@ -1,26 +1,61 @@
var detail_chart;
-$(document).ready(function(){
- var startDate = '2013-07-13';
- startDate = new Date(startDate.replace(/-/g,"/"));
- var start_date_UTC_time = startDate.getTime() - startDate.getTimezoneOffset() * 60 * 1000;
- var chart3 = new Highcharts.Chart({
+
+// set global options for hightcharts {{{
+$(function() {
+ Highcharts.setOptions ({
chart: {
- renderTo: 'chart_3',
type: 'area',
marginLeft: 15,
height: 223,
spacingTop: 10,
- spacingBottom: 0,
- overflow: false,
- zIndex: 5
+ spacingBottom: 0
+ //overflow: false,
+ //zIndex: 5
},
+ colors: ['#31B6AD'],
credits: {
enabled: false
},
+ legend: {
+ enabled: false
+ },
+ plotOptions: {
+ series: {
+ fillOpacity: 0.12,
+ lineWidth: 1,
+ marker: {
+ enabled: true, //false false的时候就不会突出显示点
+ lineColor: '#31B6AD',
+ lineWidth: 1,
+ radius: 3, // 点的大小
+ fillColor: '#FFFFFF' // 设置点中间填充的颜色
+ },
+ shadow: false
+ //threshold: null
+ }
+ },
+ //series: [{
+ // data: [6.0, 5.9, 5.5, 4.5, 6.2, 6.5, 5.2, 6.0,
+ // 5.9, 5.5, 4.5, 6.2, 6.5, 5.2, 6.0, 5.9,
+ // 5.5, 4.5, 6.2, 6.5],
+ // pointStart: start_date_UTC_time,
+ // pointInterval: 1 * 24 * 3600 * 1000 // one day
+ //}],
title: {
- text: ' '
+ text: null
+ },
+ tooltip: {
+ //formatter: function() {
+ // return '<span style="color:#969696;font-weight:bold;">' + Highcharts.dateFormat('%b %e', this.x) + '</span>' +'<br />' + '<span style="color:#464646;font-weight:bold;">' + this.y + 'mmol/L' + '</span>' + '<br />' + 'click for more info';
+ //},
+ // positioner: function (boxWidth, boxHeight, point) {
+ // return { x: point.plotX+80, y: point.plotY-20 };
+ // },
+ style: {
+ padding: '7px'
+ },
+ borderColor: '#EAEAEA'
},
- colors: ['#31B6AD'],
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
@@ -34,13 +69,13 @@ $(document).ready(function(){
step: 2,
maxStaggerLines: 1
},
- tickInterval: (4 * 24 * 3600 * 1000),
+ tickInterval: (4 * 24 * 3600 * 1000), // 4 days
tickColor: '#FFFFFF'
},
yAxis: {
- title: {
- text: ''
- },
+ //title: {
+ // text: ''
+ //},
allowDecimals: false,
endOnTick: false,
tickInterval: 1,
@@ -50,36 +85,31 @@ $(document).ready(function(){
gridLineWidth: 1,
minPadding: 0.3,
maxPadding: 1.2
+ }
+ });
+});
+// }}}
+
+$(document).ready(function(){
+ var startDate = '2013-07-13';
+ startDate = new Date(startDate.replace(/-/g,"/"));
+ var start_date_UTC_time = startDate.getTime() - startDate.getTimezoneOffset() * 60 * 1000;
+ var chart3 = new Highcharts.Chart({
+ chart: {
+ renderTo: 'chart_3'
},
- legend: {
- enabled: false
+ yAxis: {
+ title: {
+ text: ''
+ }
},
tooltip: {
formatter: function() {
return '<span style="color:#969696;font-weight:bold;">' + Highcharts.dateFormat('%b %e', this.x) + '</span>' +'<br />' + '<span style="color:#464646;font-weight:bold;">' + this.y + 'mmol/L' + '</span>' + '<br />' + 'click for more info';
- },
+ }
// positioner: function (boxWidth, boxHeight, point) {
// return { x: point.plotX+80, y: point.plotY-20 };
// },
- style: {
- padding: '7px'
- },
- borderColor: '#EAEAEA'
- },
- plotOptions: {
- series: {
- marker: {
- enabled: true, //false false的时候就不会突出显示点
- lineColor: '#31B6AD',
- lineWidth: 1,
- radius: 3, // 点的大小
- fillColor: '#FFFFFF' // 设置点中间填充的颜色
- },
- fillOpacity: 0.12,
- lineWidth: 1,
- threshold: null,
- shadow: false
- }
},
series: [{
data: [6.0, 5.9, 5.5, 4.5, 6.2, 6.5, 5.2, 6.0, 5.9, 5.5, 4.5, 6.2, 6.5, 5.2, 6.0, 5.9, 5.5, 4.5, 6.2, 6.5],
@@ -254,7 +284,8 @@ function redraw_chart(detail_chart, start, end){
url: indicator_url + 'ajax/get_card_data_chart',
data: 'card_detail_id='+card_detail_id+'&start='+start+'&end='+end+'&time='+time,
dataType: 'json',
- success: function(dataJson) { //每一天都要有数据,否则x轴刻度时间对不上
+ success: function(dataJson) {
+ //每一天都要有数据,否则x轴刻度时间对不上
var startDateLogFormat = new Date(start.replace(/-/g,"/"));
var start_date_log_UTC_time = startDateLogFormat.getTime() - startDateLogFormat.getTimezoneOffset() * 60 * 1000;
var pointStart = start_date_log_UTC_time;