提交 1ce029b6 编写于 作者: C Catouse
上级 5065b6cf
/* ======================================================================== /* ========================================================================
* Chart.js: Chart.line.js [Version: 1.0.2] * Chart.js: Chart.line.js [Version: 1.0.2]
* http://chartjs.org/ * http://chartjs.org/
* *
* ZUI: The file has been changed in ZUI. It will not keep update with the * ZUI: The file has been changed in ZUI. It will not keep update with the
* official version in the future. * official version in the future.
* http://zui.sexy * http://zui.sexy
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
/// ----- ZUI change begin ----- /// ----- ZUI change begin -----
/// Change root to zui shared object /// Change root to zui shared object
/// ///
/// var root = this, // old code /// var root = this, // old code
var root = $ && $.zui ? $.zui : this, var root = $ && $.zui ? $.zui : this,
/// ----- ZUI change end ----- /// ----- ZUI change end -----
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
//Boolean - Whether to show beyond lines //Boolean - Whether to show beyond lines
scaleShowBeyondLine: true, scaleShowBeyondLine: true,
/// ZUI change end /// ZUI change end
/// ///
//Boolean - Whether to show vertical lines (except Y axis) //Boolean - Whether to show vertical lines (except Y axis)
scaleShowVerticalLines: true, scaleShowVerticalLines: true,
...@@ -269,23 +269,24 @@ ...@@ -269,23 +269,24 @@
this.scale = new Chart.Scale(scaleOptions); this.scale = new Chart.Scale(scaleOptions);
}, },
addData: function(valuesArray, label) { addData: function(valuesArray, label) {
//Map the values array for each of the datasets //Map the values array for each of the datasets
helpers.each(valuesArray, function(value, datasetIndex) { helpers.each(valuesArray,function(value,datasetIndex){
//Add a new point for each piece of data, passing any required data to draw. //Add a new point for each piece of data, passing any required data to draw.
this.datasets[datasetIndex].points.push(new this.PointClass({ this.datasets[datasetIndex].points.push(new this.PointClass({
value: value, value : value,
label: label, label : label,
x: this.scale.calculateX(this.scale.valuesCount + 1), datasetLabel: this.datasets[datasetIndex].label,
y: this.scale.endPoint, x: this.scale.calculateX(this.scale.valuesCount+1),
strokeColor: this.datasets[datasetIndex].pointStrokeColor, y: this.scale.endPoint,
fillColor: this.datasets[datasetIndex].pointColor strokeColor : this.datasets[datasetIndex].pointStrokeColor,
})); fillColor : this.datasets[datasetIndex].pointColor
}, this); }));
},this);
this.scale.addXLabel(label);
//Then re-render the chart. this.scale.addXLabel(label);
this.update(); //Then re-render the chart.
this.update();
}, },
removeData: function() { removeData: function() {
this.scale.removeXLabel(); this.scale.removeXLabel();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册