Commit 4033d9e4 authored by Jerome Mariette's avatar Jerome Mariette
Browse files

No commit message

No commit message
parent 17a68652
......@@ -110,17 +110,50 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
</table>
<br />
<legend>4. How should the data be displayed ?</legend>
<label class="radio">
<input type="radio" name="display_b" id="project_distribution" value="project_distribution" checked>
display the projects as a pie chart
</label>
<label class="radio">
<input type="radio" name="display_b" id="project_evolution" value="project_evolution">
display the projects creation evolution
</label>
<label class="radio">
<input type="radio" name="display_b" id="data_distribution" value="data_distribution">
display the stored data as a pie chart
</label>
<label class="radio">
<input type="radio" name="display_b" id="data_evolution" value="data_evolution">
display the stored data evolution
</label>
<div class="row">
<div class="span2 offset9">
<div class="btn-group" data-toggle="buttons-radio">
<button type="button" id="project_distribution" class="multiple-selection-btn btn btn-primary"> <i class="icon-certificate icon-white"></i> distribution</button>
<button type="button" id="project_evolution" class="multiple-selection-btn btn"><i class="icon-random"></i> evolution</button>
</div>
<button type="button" id="refresh_graph_btn" class="multiple-selection-btn btn btn-primary"> <i class="icon-refresh icon-white"></i> refresh graph</button>
</div>
</div>
</div>
<br />
<div id="highcharts_graph"> </div>
<br />
<!--
<div id="chart_options" class="form-inline">
<label class="control-label" style="font-size:12px" for="group_list">Select a user group</label>
<label class="checkbox" style="font-size:12px">
<input id="chk_get_analyzes" type="checkbox">
Includes analyses
</label>
<label class="checkbox" style="font-size:12px">
<input id="chk_get_cumulative" type="checkbox">
Cumulate values
</label>
</div>
-->
</div>
<div class="tab-pane fade" id="wf_monitoring"></div>
......
......@@ -38,6 +38,7 @@ $(function () {
// statistics menu handling
$(':radio[id=select_cruser]').attr('checked','checked');
$(':radio[id=by_laboratories]').attr('checked','checked');
$(':radio[id=project_distribution]').attr('checked','checked');
$(':checkbox').each(function(){
$(this).attr("checked", false);
});
......@@ -68,6 +69,9 @@ $(function () {
$(":checkbox").change(function(){
updateButtons();
})
$(":radio[name=display_b]").change(function(){
updateButtons();
});
Highcharts.getOptions().colors = Highcharts.map(Highcharts.getOptions().colors, function(color) {
return {
......@@ -276,6 +280,8 @@ function projectEvolutionHandler() {
credits: { enabled: false },
series: [{name: "number of project", data: val}]
});
$("#refresh_graph_btn").addClass("disabled")
$("#refresh_graph_btn").unbind("click");
}
});
}
......@@ -334,7 +340,9 @@ function projectDistributionHandler() {
type: 'pie',
data: val
}]
});
});
$("#refresh_graph_btn").addClass("disabled")
$("#refresh_graph_btn").unbind("click");
}
});
}
......@@ -342,8 +350,18 @@ function projectDistributionHandler() {
}
function updateButtons () {
var nb_updated = 0;
$('.multiple-selection-btn').each(function(){
$("#refresh_graph_btn").unbind("click");
if ($(":radio[name=display_b]:checked").val() == "project_distribution") {
$("#refresh_graph_btn").bind("click", projectDistributionHandler);
} else if ($(":radio[name=display_b]:checked").val() == "project_evolution") {
$("#refresh_graph_btn").bind("click", projectEvolutionHandler);
} else if ($(":radio[name=display_b]:checked").val() == "data_distribution") {
alert("TODO: data distribution");
} else if ($(":radio[name=display_b]:checked").val() == "data_evolution") {
alert("TODO: data evolution");
}
$("#refresh_graph_btn").each(function(){
if ($("[type='checkbox']:checked").size() == 0) {
// Add tooltip
$(this).attr('rel', 'tooltip');
......@@ -351,8 +369,7 @@ function updateButtons () {
$(this).attr('data-title', 'Select one or more element(s)');
$(this).tooltip({container: 'body'});
$(this).addClass("disabled").attr("rel", "tooltip");
$("#project_distribution").unbind("click", projectDistributionHandler);
$("#project_evolution").unbind("click", projectEvolutionHandler);
$("#refresh_graph_btn").unbind("click");
} else if ($(this).hasClass("disabled")) {
// Enable
$(this).removeClass("disabled").attr("rel", null);
......@@ -360,11 +377,6 @@ function updateButtons () {
$(this).removeAttr('rel');
$(this).removeAttr('data-title');
$(this).tooltip('destroy');
if (nb_updated == 0) {
$("#project_distribution").bind("click", projectDistributionHandler);
$("#project_evolution").bind("click", projectEvolutionHandler);
}
nb_updated += 1;
}
});
}
......
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