Commit 07a3db96 authored by Benjamin Blanc's avatar Benjamin Blanc

erp5_test_result: Fix bug on x abcissa when test suite document change

parent 8c56b7ad
...@@ -65,8 +65,9 @@ body {\n ...@@ -65,8 +65,9 @@ body {\n
.bullet .title { font-size: 14px; font-weight: bold; }\n .bullet .title { font-size: 14px; font-weight: bold; }\n
</style>\n </style>\n
\n \n
<script src="http://d3js.org/d3.v3.min.js"></script>\n <script src="http://d3js.org/d3.v3.js"></script>\n
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>\n <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js" ></script>\n
\n
\n \n
</head>\n </head>\n
<body>\n <body>\n
...@@ -88,7 +89,15 @@ body {\n ...@@ -88,7 +89,15 @@ body {\n
stats = JSON.parse(json);\n stats = JSON.parse(json);\n
xs = stats.xs;\n xs = stats.xs;\n
\n \n
//TODO: smooth the intterpolation in a new curve\n if (xs.length != stats.test.length){\n
alert("The number of configuration to test ("+xs.length+", defined on test suite document) is \\\n
lower than the number of tested configurations for this test result document ("+stats.test.length+").");\n
alert("x-scale will not be respected.");\n
for(var i=xs.length; i<stats.test.length; i++){\n
xs[i]=xs[xs.length-1]+1;\n
}\n
}\n
\n
\n \n
x_max = xs[stats.test.length-1];\n x_max = xs[stats.test.length-1];\n
// just for fun..\n // just for fun..\n
...@@ -96,7 +105,7 @@ x_max = xs[stats.test.length-1];\n ...@@ -96,7 +105,7 @@ x_max = xs[stats.test.length-1];\n
// polynomial interpolation using Lagrande method\n // polynomial interpolation using Lagrande method\n
var n = stats.test.length;\n var n = stats.test.length;\n
// compute and assign value to display\n // compute and assign value to display\n
for (var i=0; i<n; i++) {\n for(var i=0; i<n; i++) {\n
stats.test[i]["value"] = 3600 * stats.test[i].created_docs / stats.test[i].duration;\n stats.test[i]["value"] = 3600 * stats.test[i].created_docs / stats.test[i].duration;\n
}\n }\n
// Lagrange interpolation\n // Lagrange interpolation\n
...@@ -145,9 +154,9 @@ var margin = {top: 20, right: 20, bottom: 30, left: 40},\n ...@@ -145,9 +154,9 @@ var margin = {top: 20, right: 20, bottom: 30, left: 40},\n
\n \n
var x0 = d3.scale.ordinal()\n var x0 = d3.scale.ordinal()\n
.rangeRoundBands([0, width], .1);\n .rangeRoundBands([0, width], .1);\n
\n
var x1 = d3.scale.ordinal();\n var x1 = d3.scale.ordinal();\n
\n \n
\n
var y = d3.scale.linear()\n var y = d3.scale.linear()\n
.range([height, 0]);\n .range([height, 0]);\n
\n \n
...@@ -248,7 +257,6 @@ var svg = d3.select("body").append("svg")\n ...@@ -248,7 +257,6 @@ var svg = d3.select("body").append("svg")\n
.attr("stroke-width", 1)\n .attr("stroke-width", 1)\n
.attr("stroke", "red");\n .attr("stroke", "red");\n
}\n }\n
\n
\n \n
//smoothed curve data computation\n //smoothed curve data computation\n
var v_1 = [];\n var v_1 = [];\n
......
266 267
\ No newline at end of file \ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment