Skip to content

Commit

Permalink
dont send fillAreas toBack() since when you have multiple filled line…
Browse files Browse the repository at this point in the history
…s you want them to render in order
  • Loading branch information
jcarver989 committed May 29, 2013
1 parent d4b4820 commit 698670a
Show file tree
Hide file tree
Showing 7 changed files with 31 additions and 22 deletions.
2 changes: 1 addition & 1 deletion build.sh
@@ -1 +1 @@
dependence src/coffeescript/ -o compiled -c
dependence src/coffeescript/ -o compiled -c
6 changes: 3 additions & 3 deletions compiled/charts.js
Expand Up @@ -1140,7 +1140,7 @@ Line = (function() {
return curve.attr({
"stroke": this.options.line_color,
"stroke-width": this.options.line_width
}).toFront();
});
};

Line.prototype.draw_area = function(path) {
Expand All @@ -1158,7 +1158,7 @@ Line = (function() {
"fill-opacity": this.options.area_opacity,
"stroke": "none"
});
return area.toBack();
return area;
};

Line.prototype.draw_dots_and_tooltips = function() {
Expand Down Expand Up @@ -1938,7 +1938,7 @@ LineChart = (function(_super) {
for (i = _i = 0, _len = _ref1.length; _i < _len; i = ++_i) {
line_indices = _ref1[i];
begin = line_indices[0], end = line_indices[1];
raw_points = this.all_points.slice(begin, +end + 1 || 9e9);
raw_points = this.all_points.slice(begin, end + 1 || 9e9);
if (this.options.multi_axis) {
_ref2 = this.all_points.length > 2 ? this.create_scalers(raw_points) : this.create_scalers_for_single_point(), line_x = _ref2[0], line_y = _ref2[1];
} else {
Expand Down
6 changes: 3 additions & 3 deletions compiled/charts.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 10 additions & 12 deletions examples/examples.js
Expand Up @@ -205,7 +205,16 @@ $(document).ready(function() {
});



log_scale.add_line({
data: [[1, 305],[2, 336],[3, 378],[4, 449],[5, 635],[6, 935],[7, 782]],
options: {
line_color: colors[2],
dot_color: colors[2],
fill_area: false,
line_width: 2,
dot_size: 3
}
});

log_scale.add_line({
data: [[1, 828906],[2, 566933],[3, 584150],[4, 1072143],[5, 1622455],[6, 2466746],[7, 2427789]],
Expand All @@ -219,17 +228,6 @@ $(document).ready(function() {
}
});

log_scale.add_line({
data: [[1, 305],[2, 336],[3, 378],[4, 449],[5, 635],[6, 935],[7, 782]],
options: {
line_color: colors[2],
dot_color: colors[2],
fill_area: false,
line_width: 2,
dot_size: 3
}
});

log_scale.draw()


Expand Down
2 changes: 1 addition & 1 deletion examples/index.html
Expand Up @@ -5,7 +5,7 @@
<link rel="stylesheet" type="text/css" href="css/examples.css" />
<link rel="stylesheet" type="text/css" href="css/syntax.css" />
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.0/jquery.min.js"></script>
<script type="text/javascript" src="https://raw.github.com/DmitryBaranovskiy/raphael/master/raphael-min.js"></script>
<script type="text/javascript" src="raphael.min.js"></script>
<script type="text/javascript" src="../compiled/charts.js"></script>
<script type="text/javascript" src="examples.js"></script>
</head>
Expand Down
11 changes: 11 additions & 0 deletions examples/raphael.min.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/coffeescript/charts/line.coffee
Expand Up @@ -34,7 +34,7 @@ class Line
curve.attr({
"stroke" : @options.line_color
"stroke-width" : @options.line_width
}).toFront()
})

draw_area: (path) ->
points = @scaled_points
Expand All @@ -53,7 +53,7 @@ class Line
"fill-opacity" : @options.area_opacity
"stroke" : "none"
})
area.toBack()
area


draw_dots_and_tooltips: () ->
Expand Down

0 comments on commit 698670a

Please sign in to comment.