Skip welcome & menu and move to editor
Welcome to JS Bin
Load cached copy from
 
<!doctype html>
<html lang="en">
<head>
  <script src="http://d3js.org/d3.v3.min.js"></script>
  <script src="http://dimplejs.org/dist/dimple.v2.1.2.min.js"></script>  
</head>
<body>
  <div id="chartContainer">
    
  </div>
</body>
</html>
 
var svg = dimple.newSvg("body", 800, 400);
// Based on dimple.plot.bubble
var myCustomPlotter = {
        stacked: false,
        grouped: false,
        supportedAxes: ["x", "y"],
        draw: function (chart, series, duration) {
            chart._group
                .selectAll(".my-series")
                .data(series._positionData)
                .enter()
                .append("path")
                // Path Generated at http://www.smiffysplace.com/stars.html
                .attr("d", "M 0 10 L 11.756 16.180 L 9.511 3.090 L 19.021 -6.180 L 5.878 -8.090 L 0 -20 L -5.878 -8.090 L -19.021 -6.180 L -9.511 3.090 L -11.756 16.180 L 0 10")
                .attr("transform", function (d) { 
                return "translate(" +
                    dimple._helpers.cx(d, chart, series) + "," + 
                    dimple._helpers.cy(d, chart, series) + ")"; 
                }) 
                .style("fill", "yellow")
                .style("stroke", "orange");
        }
    };
var data = [
  {"Month":"01/2013", "Revenue":2000, "Profit":2000, "Units":4},
  {"Month":"02/2013", "Revenue":3201, "Profit":2000, "Units":3},
  {"Month":"03/2013", "Revenue":1940, "Profit":14000, "Units":5},
  {"Month":"04/2013", "Revenue":2500, "Profit":3200, "Units":1},
  {"Month":"05/2013", "Revenue":800, "Profit":1200, "Units":4}
];
var chart = new dimple.chart(svg, data);
chart.setBounds(60,20,680,330);
var x = chart.addCategoryAxis("x", "Month");
var y = chart.addMeasureAxis("y", "Revenue");
chart.addSeries("Gross Profit", myCustomPlotter);
x.dateParseFormat = "%m/%Y";
x.addOrderRule("Date");
chart.draw();
Output

You can jump to the latest bin by adding /latest to your URL

Dismiss x
public
Bin info
johnkiernanderpro
0viewers