Commit 9e5c3495 authored by Sven Franck's avatar Sven Franck

fixed colors of graph series

parent 5b6a2378
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#results_list .start_over .ui-btn-inner { padding-top: 11px; padding-bottom: 11px; } #results_list .start_over .ui-btn-inner { padding-top: 11px; padding-bottom: 11px; }
/* graph */ /* graph */
#results_list #graph_container_cell { min-height:360px; padding: .25em; max-width: 80%; margin: 0 auto;} #results_list #graph_container_cell { min-height:360px; padding: .25em; max-width: 80%; margin: 2em auto;}
/* popups */ /* popups */
.ui-collapsible-popup {padding: 0;} .ui-collapsible-popup {padding: 0;}
.ui-collapsible-popup .ui-collapsible-set-horizontal .ui-collapsible-content {margin-top: -15px; border:0 none; padding: 0;} .ui-collapsible-popup .ui-collapsible-set-horizontal .ui-collapsible-content {margin-top: -15px; border:0 none; padding: 0;}
...@@ -210,26 +210,28 @@ ...@@ -210,26 +210,28 @@
makeColors = function (array, get, axis) { makeColors = function (array, get, axis) {
var pos, colorObject = {}, colorArray = []; var pos, colorObject = {}, colorArray = [];
if (get === "max") { //if (get === "max") {
pos = arrayMax(array); // pos = arrayMax(array);
} else { //} else {
pos = arrayMin(array); // pos = arrayMin(array);
} //}
for (i = 0; i < array.length; i += 1) { // highlight min/max value, rest gray... not working well with 4 series
if (array[i] === pos || array.length === 1) { //for (i = 0; i < array.length; i += 1) {
colorArray.push("#2DBCF8"); // if (array[i] === pos || array.length === 1) {
} else { // colorArray.push("#2DBCF8");
colorArray.push("#ccc"); // } else {
} // colorArray.push("#ccc");
} // }
colorObject.series_colors = colorArray; //}
//colorObject.series_colors = colorArray;
//add rest, too... //add rest, too...
if (axis === "log") { if (axis === "log") {
colorObject.yaxis = "yaxis"; colorObject.yaxis = "yaxis";
} else { } else {
colorObject.yaxis = "y2axis"; colorObject.yaxis = "y2axis";
} }
colorObject.legend = "#ccc"; colorObject.pointLabels = {edgeTolerance: -50}
// colorObject.legend = "#ccc";
return colorObject; return colorObject;
}, },
...@@ -631,7 +633,7 @@ ...@@ -631,7 +633,7 @@
// title: 'Performance Benchmarks', // title: 'Performance Benchmarks',
seriesDefaults:{ seriesDefaults:{
renderer:$.jqplot.BarRenderer, renderer:$.jqplot.BarRenderer,
rendererOptions:{ varyBarColor : true, barWidth: useBarWidth } rendererOptions:{ /* varyBarColor : true,*/ barWidth: useBarWidth }
}, },
tickDefaults: { tickDefaults: {
syncTicks: true, syncTicks: true,
...@@ -655,7 +657,7 @@ ...@@ -655,7 +657,7 @@
// autoscale: true // autoscale: true
}, },
y2axis:{ y2axis:{
label: 'Uptime (%), Cost($/h)', label: 'Uptime (%), Cost ($/h)',
// renderer: $.jqplot.CategoryAxisRenderer, // renderer: $.jqplot.CategoryAxisRenderer,
//btickSpacing: 50, //btickSpacing: 50,
// min: 0, // min: 0,
...@@ -669,6 +671,7 @@ ...@@ -669,6 +671,7 @@
legend: { legend: {
show: true, show: true,
placement: 'outsideGrid' placement: 'outsideGrid'
// location:'s'
} }
}; };
...@@ -708,6 +711,8 @@ ...@@ -708,6 +711,8 @@
plotOpts.legend.labels = plotLables; plotOpts.legend.labels = plotLables;
plotOpts.series = series_colors; plotOpts.series = series_colors;
console.log(plotOpts)
// now we plot - only if a series is shown // now we plot - only if a series is shown
if (plotSeries.length !== 0) { if (plotSeries.length !== 0) {
plot1 = $.jqplot('graph_container_cell', plotSeries, plotOpts); plot1 = $.jqplot('graph_container_cell', plotSeries, plotOpts);
......
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