1 <h2>DragonFly BSD Performance</h2>
4 <script type="text/javascript" src="jquery-1.8.2.min.js"></script>
5 <script type="text/javascript" src="d3.v2.min.js"></script>
10 background-image: url("chart_bg.png");
11 background-repeat: no-repeat;
12 background-position: right top;
45 $(document).ready(function(){
46 var chart_width = 600;
47 var chart_height = 348;
48 var chart_margin = 80; // Margin is at left and bottom only
49 var chart_padding = 20; // padding is at top and right
51 var perf_swapcache_data = [
52 {title: "DragonFly BSD 3.2", values: [100.00, 99.72, 5.78, 1.49, 0.96, 0.84, 0.64]},
53 {title: "With Swapcache", values: [99.48, 99.03, 78.30, 49.40, 37.95, 31.06, 27.17]}
55 var swapcache_x = ["50%", "75%", "100%", "125%", "150%", "175%", "200%"];
57 var xscaler = d3.scale.linear()
59 .range([chart_margin, chart_width + chart_margin]);
60 var yscaler = d3.scale.linear()
62 .range([chart_padding, chart_height]);
64 var xaxis = d3.svg.axis()
68 var yaxis = d3.svg.axis()
73 var chart = d3.select("#swapcache_chart")
75 .attr("width", chart_width + chart_margin + chart_padding)
76 .attr("height", chart_height + chart_margin + chart_padding);
79 * The line function uses the scalers and kicks back x,y coordinates for
82 var linefn = d3.svg.line()
91 * Add a container for the lines
93 var chart_data = chart.append("svg:g")
94 .attr("transform", "translate(0, 0)");
97 * Add the data to chart
99 chart_data.append("svg:path")
100 .attr("class", "df32")
101 .attr("d", linefn(perf_swapcache_data[0].values));
102 chart_data.append("svg:path")
103 .attr("class", "swapcache")
104 .attr("d", linefn(perf_swapcache_data[1].values));
109 chart.append("svg:g")
110 .attr("class", "x axis")
111 .attr("transform", "translate(0, " + (chart_height + 1) + ")")
115 return (swapcache_x[parseInt(d)]);
121 chart.append("svg:g")
122 .attr("class", "y axis")
123 .attr("transform", "translate(" + (chart_margin) + ", 0)")
134 chart.append("svg:text")
135 .attr("class", "xlabel")
137 .attr("y", chart_height + chart_padding + 20)
138 .text("Database size relative to main memory size");
140 chart.append("svg:text")
141 .attr("class", "ylabel")
144 .attr("text-anchor", "end")
145 .attr("transform", "rotate(-90)")
146 .text("Percentage of performance relative to maximum");
151 var k = chart.append("svg:g")
152 .attr("transform", "translate(450, 20)");
156 .text(perf_swapcache_data[0].title);
158 .attr("class", "df32")
159 .attr("d", "M0 -5 L100 -5");
163 .text(perf_swapcache_data[1].title);
165 .attr("class", "swapcache")
166 .attr("d", "M0 15 L100 15");
168 }); /* document.ready */
171 <div id="swapcache_chart" class="chart container">