TableGenerator: show additional lines in ScatterPlot for factor '.1' and '10'.
@@ -1078,6 +1078,7 @@ var graphData = {
isQuantile : true,
isLogScale : true,
showCorrectOnly : true,
+ secondLineFactor : 10,
};
// this function collects the indices of columns with target as cell above the column
@@ -1441,6 +1442,24 @@ function getSelectorForScatter(identifier) {
return select;
}
+function getSecondLineFactorForScatter() {
+ var select = $('<select>', {class:'plot-second-line-factor'});
+ for (var number = 1; number < Math.pow(10,10);
+ number = (number < 10) ? (number + 1) : (number * 10)) {
+ select.append($('<option>', {
+ value:number,
+ selected:(graphData.secondLineFactor == number)})
+ .text(number));
+ }
+ select.change(function(){
+ var selectedValue = Number(select.find(':selected')[0].value);
+ graphData.secondLineFactor = selectedValue;
+ showScatterPlot();
+ });
+
+ return select;
+}
+
function showScatterPlot() {
hideContentPane(); // cleanup
var contentPane = $('#contentPane').append('<div id="chart"></div>');
@@ -1451,6 +1470,7 @@ function showScatterPlot() {
// it identifies the first and second selector
var selector0 = getSelectorForScatter(0);
var selector1 = getSelectorForScatter(1);
+ var selectorSecondLineFactor = getSecondLineFactorForScatter();
var index0 = graphData.target[0];
var index1 = graphData.target[1];
var title0 = columnTitleCells[index0].textContent;
@@ -1522,12 +1542,28 @@ function showScatterPlot() {
objects: [
{line: {
name: 'diagonalLine',
- lineWidth: 1,
+ lineWidth: 2,
color: 'red',
shadow: false,
start: [minValue, minValue],
stop: [maxValue, maxValue],
}},
+ {line: {
+ name: 'diagonalLineAbove',
+ lineWidth: 1,
+ color: 'red',
+ shadow: false,
+ start: [minValue, minValue*graphData.secondLineFactor],
+ stop: [maxValue, maxValue*graphData.secondLineFactor],
+ }},
+ {line: {
+ name: 'diagonalLineBelow',
+ lineWidth: 1,
+ color: 'red',
+ shadow: false,
+ start: [minValue, minValue/graphData.secondLineFactor],
+ stop: [maxValue, maxValue/graphData.secondLineFactor],
+ }},
]
}
});
@@ -1535,7 +1571,9 @@ function showScatterPlot() {
$('.jqplot-title').empty()
.append('X: ').append(selector0)
.append('<span style="padding-left:50px"></span>') // some space between the selectors
- .append('Y: ').append(selector1);
+ .append('Y: ').append(selector1)
+ .append('<span style="padding-left:50px"></span>') // some space between the selectors
+ .append('line: ').append(selectorSecondLineFactor);
$('#contentPaneBackground').click(function(event) {
plot.destroy();
