<script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
<style>
#temp_pue_wrapper {
position: relative;
height: 0;
width: 100%;
padding: 0;
/* padding-bottom will be overwritten by JavaScript later */
padding-bottom: 100%;
}
#temp_pue_wrapper > svg {
position: absolute;
height: 100%;
width: 100%;
left: 0;
top: 0;
}
</style>
<div id="temp_pue_wrapper"></div>
<script>
var width = 500,
height = 30,
tmp_wrapper = d3.select("#temp_pue_wrapper")
.attr(
"style",
"padding-bottom: " + Math.ceil(height * 85 / width) + "%"
)
.append("svg")
.attr("viewBox", "0 0 " + width + " " + height);
var gradient = tmp_wrapper.append("defs")
.append("linearGradient")
.attr("id", "gradient")
.attr("x1", "0%")
.attr("y1", "0%")
.attr("x2", "100%")
.attr("y2", "0%")
.attr("spreadMethod", "pad");
gradient.append("stop")
.attr("offset", "0%")
.attr("stop-color", "#228582")
.attr("stop-opacity", 1);
gradient.append("stop")
.attr("offset", "50%")
.attr("stop-color", "#228582")
.attr("stop-opacity", 1);
gradient.append("stop")
.attr("offset", "50%")
.attr("stop-color", "#C23439")
.attr("stop-opacity", 1);
gradient.append("stop")
.attr("offset", "100%")
.attr("stop-color", "#C23439")
.attr("stop-opacity", 1);
tmp_wrapper.append('rect')
.attr("width", "100%")
.attr("height", "100%")
.attr("fill", "url(#gradient)");
</script>
 <script src="https://cdnjs.cloudflare.com/ajax/libs/d3/3.5.17/d3.min.js"></script>
 Â
  <style>
  #temp_pue_wrapper {
    position: relative;
    height: 0;
    width: 100%;
    padding: 0;
    /* padding-bottom will be overwritten by JavaScript later */
    padding-bottom: 100%;
       Â
  }
  #temp_pue_wrapper > svg {
    position: absolute;
    height: 100%;
    width: 100%;
    left: 0;
    top: 0;
  }
   Â
Â
    path {
        fill: none;
    }   Â
  </style>
  <div id="temp_pue_wrapper"></div>
   Â
  <script>
  var width = 500,
    height = 30,
    tmp_wrapper = d3.select("#temp_pue_wrapper")
      .attr(
        "style",
        "padding-bottom: " + Math.ceil(height * 80 / width) + "%"
        .attr("width", "88.8%")
        .attr("height", "100%")
        .attr("x", "29px")
        .attr("y", "0px")           Â
        .attr("fill", "url(#gradient)")
            .attr("class","foo");
           Â
    tmp_wrapper.append("svg:path")  // Fixed.
         .attr("d", d3.svg.symbol().type("triangle-up").size(400))
         .style("fill", "#228582")
         .attr ("transform", "translate(17,15) rotate (-90)");
           Â
    tmp_wrapper.append("svg:path")  // Fixed.
         .attr("d", d3.svg.symbol().type("triangle-up").size(400))
         .style("fill", "#C23439")
         .attr ("transform", "translate(485,15) rotate (90)");
           Â
        //This is the accessor function we talked about above
    var lineFunction = d3.svg.line()
     .x(function(d) { return d.x; })
     .y(function(d) { return d.y; })
     .interpolate('linear');
    //The data for our line
    var lineData = [
     { "x": -5,  "y": 0}, Â
     { "x": 20,  "y": 0},
     { "x": -5,  "y": 15},
     { "x": 20,  "y": 30},
     { "x": -5,  "y": 30}, Â
     { "x": -30, "y": 15},
     { "x": -5, "y": 0}
    ];
    Â
    //The line SVG Path we draw
    var lineGraph = tmp_wrapper.append("path")
     .attr("d", lineFunction(lineData))
     .style("fill", "#228582");  Â
    var lineGraph1 = tmp_wrapper.append("path")
     .attr("d", lineFunction(lineData))
     .style("fill", "#C23439")
     .attr ("transform", "translate(502,30) rotate(180)");
       Â
  </script>
   Â