Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/phpmyadmin/phpmyadmin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhura Jayaratne <madhura.cj@gmail.com>2013-12-25 07:42:01 +0400
committerMadhura Jayaratne <madhura.cj@gmail.com>2013-12-25 07:42:01 +0400
commit00862e5d47d92f4cb974eec542a9afefa6e818be (patch)
tree560dd6b8568157539f330df7ae5b42cb36ce28f0 /js/tbl_chart.js
parent90620746731d6aa21a28b3329d3f2c7c508f5102 (diff)
Stacking only makes sense for some chart types
Signed-off-by: Madhura Jayaratne <madhura.cj@gmail.com>
Diffstat (limited to 'js/tbl_chart.js')
-rw-r--r--js/tbl_chart.js24
1 files changed, 13 insertions, 11 deletions
diff --git a/js/tbl_chart.js b/js/tbl_chart.js
index fea2ff8b28..4f68a652a2 100644
--- a/js/tbl_chart.js
+++ b/js/tbl_chart.js
@@ -110,7 +110,7 @@ function drawChart() {
currentSettings.width = $('#resizer').width() - 20;
currentSettings.height = $('#resizer').height() - 20;
- // todo: a better way using .redraw() ?
+ // TODO: a better way using .redraw() ?
if (currentChart !== null) {
currentChart.destroy();
}
@@ -181,21 +181,20 @@ AJAX.registerOnload('tbl_chart.js', function () {
// handle chart type changes
$('input[name="chartType"]').click(function () {
- currentSettings.type = $(this).val();
- drawChart();
- if ($(this).val() == 'bar' || $(this).val() == 'column' ||
- $(this).val() == 'line' || $(this).val() == 'area' ||
- $(this).val() == 'timeline' || $(this).val() == 'spline'
- ) {
+ var type = currentSettings.type = $(this).val();
+ if (type == 'bar' || type == 'column' || type == 'area') {
$('span.barStacked').show();
} else {
+ $('input[name="barStacked"]').attr('checked', false);
+ $.extend(true, currentSettings, {stackSeries : false});
$('span.barStacked').hide();
}
+ drawChart();
});
// handle stacking for bar, column and area charts
$('input[name="barStacked"]').click(function () {
- if (this.checked) {
+ if ($(this).is(':checked')) {
$.extend(true, currentSettings, {stackSeries : true});
} else {
$.extend(true, currentSettings, {stackSeries : false});
@@ -204,16 +203,19 @@ AJAX.registerOnload('tbl_chart.js', function () {
});
// handle changes in chart title
- $('input[name="chartTitle"]').focus(function () {
+ $('input[name="chartTitle"]')
+ .focus(function () {
temp_chart_title = $(this).val();
- }).keyup(function () {
+ })
+ .keyup(function () {
var title = $(this).val();
if (title.length === 0) {
title = ' ';
}
currentSettings.title = $('input[name="chartTitle"]').val();
drawChart();
- }).blur(function () {
+ })
+ .blur(function () {
if ($(this).val() != temp_chart_title) {
drawChart();
}