Comparar commits
19 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 02e535cdad | |||
| 3e1b120cbe | |||
| 95844701bd | |||
| 403b6751ab | |||
| 2b81ac832a | |||
| 3f9e5ab7a2 | |||
| 23deaa9307 | |||
| 2183d09b58 | |||
| ea9d144c71 | |||
| 7a23131366 | |||
| d7632efe65 | |||
| 477e09f1d4 | |||
| 641fc02212 | |||
| a55fdaad57 | |||
| d006558e69 | |||
| 29ae3200a7 | |||
| 38d1b87e1c | |||
| e139ab8596 | |||
| 28dd492460 |
externo
+24
-14
@@ -873,7 +873,9 @@
|
||||
yMin;
|
||||
helpers.each(this.datasets, function(dataset){
|
||||
dataCollection = dataset.points || dataset.bars || dataset.segments;
|
||||
Elements.push(dataCollection[dataIndex]);
|
||||
if (dataCollection[dataIndex]){
|
||||
Elements.push(dataCollection[dataIndex]);
|
||||
}
|
||||
});
|
||||
|
||||
helpers.each(Elements, function(element) {
|
||||
@@ -1042,25 +1044,27 @@
|
||||
|
||||
|
||||
Chart.Point = Chart.Element.extend({
|
||||
inRange : function(chartX,chartY){
|
||||
display: true,
|
||||
inRange: function(chartX,chartY){
|
||||
var hitDetectionRange = this.hitDetectionRadius + this.radius;
|
||||
return ((Math.pow(chartX-this.x, 2)+Math.pow(chartY-this.y, 2)) < Math.pow(hitDetectionRange,2));
|
||||
},
|
||||
draw : function(){
|
||||
var ctx = this.ctx;
|
||||
ctx.beginPath();
|
||||
if (this.display){
|
||||
var ctx = this.ctx;
|
||||
ctx.beginPath();
|
||||
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
|
||||
ctx.closePath();
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
|
||||
ctx.closePath();
|
||||
|
||||
ctx.strokeStyle = this.strokeColor;
|
||||
ctx.lineWidth = this.strokeWidth;
|
||||
ctx.strokeStyle = this.strokeColor;
|
||||
ctx.lineWidth = this.strokeWidth;
|
||||
|
||||
ctx.fillStyle = this.fillColor;
|
||||
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.fillStyle = this.fillColor;
|
||||
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
|
||||
//Quick debug for bezier curve splining
|
||||
@@ -1871,6 +1875,8 @@
|
||||
define(function(){
|
||||
return Chart;
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
module.exports = Chart;
|
||||
}
|
||||
|
||||
root.Chart = Chart;
|
||||
@@ -1992,6 +1998,7 @@
|
||||
datasetObject.bars.push(new this.BarClass({
|
||||
value : dataPoint,
|
||||
label : data.labels[index],
|
||||
datasetLabel: dataset.label,
|
||||
strokeColor : dataset.strokeColor,
|
||||
fillColor : dataset.fillColor,
|
||||
highlightFill : dataset.highlightFill || dataset.fillColor,
|
||||
@@ -2419,6 +2426,7 @@
|
||||
this.PointClass = Chart.Point.extend({
|
||||
strokeWidth : this.options.pointDotStrokeWidth,
|
||||
radius : this.options.pointDotRadius,
|
||||
display: this.options.pointDot,
|
||||
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
||||
ctx : this.chart.ctx,
|
||||
inRange : function(mouseX){
|
||||
@@ -2465,8 +2473,7 @@
|
||||
datasetObject.points.push(new this.PointClass({
|
||||
value : dataPoint,
|
||||
label : data.labels[index],
|
||||
// x: this.scale.calculateX(index),
|
||||
// y: this.scale.endPoint,
|
||||
datasetLabel: dataset.label,
|
||||
strokeColor : dataset.pointStrokeColor,
|
||||
fillColor : dataset.pointColor,
|
||||
highlightFill : dataset.pointHighlightFill || dataset.pointColor,
|
||||
@@ -3023,6 +3030,7 @@
|
||||
this.PointClass = Chart.Point.extend({
|
||||
strokeWidth : this.options.pointDotStrokeWidth,
|
||||
radius : this.options.pointDotRadius,
|
||||
display: this.options.pointDot,
|
||||
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
||||
ctx : this.chart.ctx
|
||||
});
|
||||
@@ -3073,6 +3081,7 @@
|
||||
datasetObject.points.push(new this.PointClass({
|
||||
value : dataPoint,
|
||||
label : data.labels[index],
|
||||
datasetLabel: dataset.label,
|
||||
x: (this.options.animation) ? this.scale.xCenter : pointPosition.x,
|
||||
y: (this.options.animation) ? this.scale.yCenter : pointPosition.y,
|
||||
strokeColor : dataset.pointStrokeColor,
|
||||
@@ -3227,6 +3236,7 @@
|
||||
this.eachPoints(function(point){
|
||||
point.save();
|
||||
});
|
||||
this.reflow();
|
||||
this.render();
|
||||
},
|
||||
reflow: function(){
|
||||
|
||||
externo
+2
-2
Diff do arquivo suprimido porque uma ou mais linhas são muito longas
@@ -22,4 +22,5 @@ New contributions to the library are welcome, just a couple of guidelines:
|
||||
- Please ensure you're changing the individual files in `/src`, not the concatenated output in the `Chart.js` file in the root of the repo.
|
||||
- Please check that your code will pass `jshint` code standards, `gulp jshint` will run this for you.
|
||||
- Please keep pull requests concise, and document new functionality in the relevant `.md` file.
|
||||
- Consider whether your changes are useful for all users, or if creating a Chart.js extension would be more appropriate.
|
||||
- Consider whether your changes are useful for all users, or if creating a Chart.js extension would be more appropriate.
|
||||
- Please avoid committing in the build Chart.js & Chart.min.js file, as it causes conflicts when merging.
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Chart.js",
|
||||
"version": "1.0.0-beta",
|
||||
"version": "1.0.1-beta.2",
|
||||
"description": "Simple HTML5 Charts using the canvas element",
|
||||
"homepage": "https://github.com/nnnick/Chart.js",
|
||||
"author": "nnnick",
|
||||
|
||||
@@ -11,7 +11,7 @@ First we need to include the Chart.js library on the page. The library occupies
|
||||
<script src="Chart.js"></script>
|
||||
```
|
||||
|
||||
Alternatively, if you're using an AMD loader for javascript modules, that is also supported in the Chart.js core. Please note: the library will still occupy a global variable of `Chart`, even if it detects `define` and `define.amd`. If this is a problem, you can call `noConflict` to restore the global Chart variable to it's previous owner.
|
||||
Alternatively, if you're using an AMD loader for JavaScript modules, that is also supported in the Chart.js core. Please note: the library will still occupy a global variable of `Chart`, even if it detects `define` and `define.amd`. If this is a problem, you can call `noConflict` to restore the global Chart variable to it's previous owner.
|
||||
|
||||
```javascript
|
||||
// Using requirejs
|
||||
|
||||
@@ -111,7 +111,7 @@ Chart.types.Line.extend({
|
||||
name: "LineAlt",
|
||||
initialize: function(data){
|
||||
console.log('My Line chart extension');
|
||||
Chart.types.Line.prototype.apply(this, arguments);
|
||||
Chart.types.Line.prototype.initialize.apply(this, arguments);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -122,7 +122,7 @@ new Chart(ctx).LineAlt(data);
|
||||
|
||||
### Creating custom builds
|
||||
|
||||
Chart.js uses <a href="http://gulpjs.com/" target="_blank">gulp</a> to build the library into a single javascript file. We can use this same build script with custom parameters in order to build a custom version.
|
||||
Chart.js uses <a href="http://gulpjs.com/" target="_blank">gulp</a> to build the library into a single JavaScript file. We can use this same build script with custom parameters in order to build a custom version.
|
||||
|
||||
Firstly, we need to ensure development dependencies are installed. With node and npm installed, after cloning the Chart.js repo to a local directory, and navigating to that directory in the command line, we can run the following:
|
||||
|
||||
@@ -131,7 +131,7 @@ npm install
|
||||
npm install -g gulp
|
||||
```
|
||||
|
||||
This will install the local development dependencies for Chart.js, along with a CLI for the javascript task runner <a href="http://gulpjs.com/" target="_blank">gulp</a>.
|
||||
This will install the local development dependencies for Chart.js, along with a CLI for the JavaScript task runner <a href="http://gulpjs.com/" target="_blank">gulp</a>.
|
||||
|
||||
Now, we can run the `gulp build` task, and pass in a comma seperated list of types as an argument to build a custom version of Chart.js with only specified chart types.
|
||||
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ Some important points to note in my experience using ExplorerCanvas as a fallbac
|
||||
|
||||
### Bugs & issues
|
||||
|
||||
Please report these on the Github page - at <a href="https://github.com/nnnick/Chart.js" target="_blank">github.com/nnnick/Chart.js</a>. If you could include a link to a simple <a href="http://jsbin.com/" target="_blank">jsbin</a> or similar to demonstrate the issue, that'd be really helpful.
|
||||
Please report these on the GitHub page - at <a href="https://github.com/nnnick/Chart.js" target="_blank">github.com/nnnick/Chart.js</a>. If you could include a link to a simple <a href="http://jsbin.com/" target="_blank">jsbin</a> or similar to demonstrate the issue, that'd be really helpful.
|
||||
|
||||
|
||||
### Contributing
|
||||
|
||||
+1
-2
@@ -2,8 +2,7 @@
|
||||
"name": "Chart.js",
|
||||
"homepage": "http://www.chartjs.org",
|
||||
"description": "Simple HTML5 charts using the canvas element.",
|
||||
"private": true,
|
||||
"version": "1.0.0-beta",
|
||||
"version": "1.0.1-beta.2",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/nnnick/Chart.js.git"
|
||||
|
||||
@@ -109,6 +109,7 @@
|
||||
datasetObject.bars.push(new this.BarClass({
|
||||
value : dataPoint,
|
||||
label : data.labels[index],
|
||||
datasetLabel: dataset.label,
|
||||
strokeColor : dataset.strokeColor,
|
||||
fillColor : dataset.fillColor,
|
||||
highlightFill : dataset.highlightFill || dataset.fillColor,
|
||||
|
||||
+18
-12
@@ -873,7 +873,9 @@
|
||||
yMin;
|
||||
helpers.each(this.datasets, function(dataset){
|
||||
dataCollection = dataset.points || dataset.bars || dataset.segments;
|
||||
Elements.push(dataCollection[dataIndex]);
|
||||
if (dataCollection[dataIndex]){
|
||||
Elements.push(dataCollection[dataIndex]);
|
||||
}
|
||||
});
|
||||
|
||||
helpers.each(Elements, function(element) {
|
||||
@@ -1042,25 +1044,27 @@
|
||||
|
||||
|
||||
Chart.Point = Chart.Element.extend({
|
||||
inRange : function(chartX,chartY){
|
||||
display: true,
|
||||
inRange: function(chartX,chartY){
|
||||
var hitDetectionRange = this.hitDetectionRadius + this.radius;
|
||||
return ((Math.pow(chartX-this.x, 2)+Math.pow(chartY-this.y, 2)) < Math.pow(hitDetectionRange,2));
|
||||
},
|
||||
draw : function(){
|
||||
var ctx = this.ctx;
|
||||
ctx.beginPath();
|
||||
if (this.display){
|
||||
var ctx = this.ctx;
|
||||
ctx.beginPath();
|
||||
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
|
||||
ctx.closePath();
|
||||
ctx.arc(this.x, this.y, this.radius, 0, Math.PI*2);
|
||||
ctx.closePath();
|
||||
|
||||
ctx.strokeStyle = this.strokeColor;
|
||||
ctx.lineWidth = this.strokeWidth;
|
||||
ctx.strokeStyle = this.strokeColor;
|
||||
ctx.lineWidth = this.strokeWidth;
|
||||
|
||||
ctx.fillStyle = this.fillColor;
|
||||
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
ctx.fillStyle = this.fillColor;
|
||||
|
||||
ctx.fill();
|
||||
ctx.stroke();
|
||||
}
|
||||
|
||||
|
||||
//Quick debug for bezier curve splining
|
||||
@@ -1871,6 +1875,8 @@
|
||||
define(function(){
|
||||
return Chart;
|
||||
});
|
||||
} else if (typeof module === 'object' && module.exports) {
|
||||
module.exports = Chart;
|
||||
}
|
||||
|
||||
root.Chart = Chart;
|
||||
|
||||
+2
-2
@@ -57,6 +57,7 @@
|
||||
this.PointClass = Chart.Point.extend({
|
||||
strokeWidth : this.options.pointDotStrokeWidth,
|
||||
radius : this.options.pointDotRadius,
|
||||
display: this.options.pointDot,
|
||||
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
||||
ctx : this.chart.ctx,
|
||||
inRange : function(mouseX){
|
||||
@@ -103,8 +104,7 @@
|
||||
datasetObject.points.push(new this.PointClass({
|
||||
value : dataPoint,
|
||||
label : data.labels[index],
|
||||
// x: this.scale.calculateX(index),
|
||||
// y: this.scale.endPoint,
|
||||
datasetLabel: dataset.label,
|
||||
strokeColor : dataset.pointStrokeColor,
|
||||
fillColor : dataset.pointColor,
|
||||
highlightFill : dataset.pointHighlightFill || dataset.pointColor,
|
||||
|
||||
@@ -70,6 +70,7 @@
|
||||
this.PointClass = Chart.Point.extend({
|
||||
strokeWidth : this.options.pointDotStrokeWidth,
|
||||
radius : this.options.pointDotRadius,
|
||||
display: this.options.pointDot,
|
||||
hitDetectionRadius : this.options.pointHitDetectionRadius,
|
||||
ctx : this.chart.ctx
|
||||
});
|
||||
@@ -120,6 +121,7 @@
|
||||
datasetObject.points.push(new this.PointClass({
|
||||
value : dataPoint,
|
||||
label : data.labels[index],
|
||||
datasetLabel: dataset.label,
|
||||
x: (this.options.animation) ? this.scale.xCenter : pointPosition.x,
|
||||
y: (this.options.animation) ? this.scale.yCenter : pointPosition.y,
|
||||
strokeColor : dataset.pointStrokeColor,
|
||||
@@ -274,6 +276,7 @@
|
||||
this.eachPoints(function(point){
|
||||
point.save();
|
||||
});
|
||||
this.reflow();
|
||||
this.render();
|
||||
},
|
||||
reflow: function(){
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário