Skip to content
This repository has been archived by the owner on Dec 17, 2017. It is now read-only.

Commit

Permalink
Update clizia.js
Browse files Browse the repository at this point in the history
  • Loading branch information
glasnt committed Oct 2, 2014
1 parent 24549c4 commit efa23c9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions vendor/assets/javascripts/clizia.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,9 @@ Clizia.Graph.Rickshaw.Stacked = function(args) {

if (that.right.length === 0) { that.hasRight = false }
else { that.hasRight = true; }

that.stack = args.stack || "off";
that.renderer = args.renderer || "line";

}

Expand Down Expand Up @@ -514,7 +517,10 @@ Clizia.Graph.Rickshaw.Stacked = function(args) {
scale: scale
})
}


config = {}
config.renderer = that.renderer;
config.stack = that.stack;
config.interpolate = "monotone";

if (that.hasRight && that.hasLeft ) {
Expand Down Expand Up @@ -588,7 +594,7 @@ Clizia.Graph.Rickshaw.Stacked = function(args) {

// Make stacks easier to see by adding an alpha transperancy to both
// the graph and the legend
if (config.stack === false && (config.renderer == "area")) {
if (that.stack === false && (that.renderer == "area")) {
$(document.head).append("<style>path.area{opacity:0.8};.legend-color{opacity:0.8}</style>");
}

Expand Down Expand Up @@ -692,7 +698,7 @@ Clizia.Graph.Rickshaw.Stacked = function(args) {


// Stacked graphs will order last to first, so flip the legend, for sanity
if (config.stack) { left = left.reverse(); right = right.reverse() }
if (that.stack) { left = left.reverse(); right = right.reverse() }

if (left[0]) { table.push(rtd("Left")) }
left.forEach(function(d){ row = tableize(d); table.push(row) })
Expand Down

0 comments on commit efa23c9

Please sign in to comment.