Comparar commits

..

7 Commits

Autor SHA1 Mensagem Data
Evert Timberg 87c8f51578 Merge pull request #2237 from troywarr/v2.0-dev
Fix "main" file path in bower.json
2016-04-10 20:15:34 -04:00
Troy Warr 5fa6003361 fix "main" file path in bower.json 2016-04-10 18:59:03 -05:00
Evert Timberg 00004fdd3b Merge pull request #2234 from nnnick/fix/2223
Don't measure undefined or null strings.
2016-04-10 10:15:52 -04:00
Evert Timberg 68b493732c Don't measure undefined or null strings. 2016-04-10 10:10:31 -04:00
Evert Timberg e93677e0c8 Merge pull request #2233 from jamiepenney/v2.0-dev
Update Line chart documentation
2016-04-09 19:33:10 -04:00
Jamie Penney 8fca9540ab Document the point radius setting 2016-04-10 11:15:55 +12:00
Jamie Penney 8c2bc34b9c Fix whitespace in Line Chart documentation 2016-04-10 11:04:23 +12:00
3 arquivos alterados com 26 adições e 15 exclusões
+2 -2
Ver Arquivo
@@ -5,9 +5,9 @@
"homepage": "https://github.com/nnnick/Chart.js",
"author": "nnnick",
"main": [
"Chart.js"
"dist/Chart.js"
],
"devDependencies": {
"jquery": "~2.1.4"
}
}
}
+13 -7
Ver Arquivo
@@ -48,16 +48,16 @@ var data = {
borderColor: "rgba(220,220,220,1)",
// String - cap style of the line. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineCap
borderCapStyle: 'butt',
borderCapStyle: 'butt',
// Array - Length and spacing of dashes. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
borderDash: [],
// Array - Length and spacing of dashes. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/setLineDash
borderDash: [],
// Number - Offset for line dashes. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset
borderDashOffset: 0.0,
// Number - Offset for line dashes. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineDashOffset
borderDashOffset: 0.0,
// String - line join style. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin
borderJoinStyle: 'miter',
// String - line join style. See https://developer.mozilla.org/en-US/docs/Web/API/CanvasRenderingContext2D/lineJoin
borderJoinStyle: 'miter',
// String or array - Point stroke color
pointBorderColor: "rgba(220,220,220,1)",
@@ -83,6 +83,9 @@ var data = {
// Tension - bezier curve tension of the line. Set to 0 to draw straight Wlines connecting points
tension: 0.1,
// Number - the pixel size of the point shape. Can be set to 0 to not render a circle over the point
radius: 1,
// The actual data
data: [65, 59, 80, 81, 56, 55, 40],
@@ -123,6 +126,9 @@ Name | Type | Default | Description
showLines | Boolean | true | If false, the lines between points are not drawn
stacked | Boolean | false | If true, lines stack on top of each other along the y axis.
*hover*.mode | String | "label" | Label's hover mode. "label" is used since the x axis displays data by the index in the dataset.
elements | - | - | -
*elements*.point | - | - | -
*elements.point*.radius | Number | `3` | Defines the size of the Point shape. Can be set to zero to skip rendering a point.
scales | - | - | -
*scales*.xAxes | Array | `[{type:"category","id":"x-axis-1"}]` | Defines all of the x axes used in the chart. See the [scale documentation](#getting-started-scales) for details on the available options.
*Options for xAxes* | | |
+11 -6
Ver Arquivo
@@ -830,13 +830,18 @@ module.exports = function(Chart) {
ctx.font = font;
var longest = 0;
helpers.each(arrayOfStrings, function(string) {
var textWidth = cache.data[string];
if (!textWidth) {
textWidth = cache.data[string] = ctx.measureText(string).width;
cache.garbageCollect.push(string);
// Undefined strings should not be measured
if (string !== undefined && string !== null) {
var textWidth = cache.data[string];
if (!textWidth) {
textWidth = cache.data[string] = ctx.measureText(string).width;
cache.garbageCollect.push(string);
}
if (textWidth > longest) {
longest = textWidth;
}
}
if (textWidth > longest)
longest = textWidth;
});
var gcLen = cache.garbageCollect.length / 2;