From 031065b6200829175f4ea0b998123302ea2ac4d8 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Fri, 31 Aug 2012 15:05:23 -0400 Subject: [PATCH] Initial porting of bar charts --- js/tbl_chart.js | 51 +++++++++++++++++-------------------------------- 1 file changed, 18 insertions(+), 33 deletions(-) diff --git a/js/tbl_chart.js b/js/tbl_chart.js index fdacd3297a..cc6439c4b0 100644 --- a/js/tbl_chart.js +++ b/js/tbl_chart.js @@ -229,51 +229,36 @@ function PMA_queryChart(data, passedSettings, passedNonJqplotSettings) break; } - // Prevent the user from seeing the JSON code - //$('div#profilingchart').html('').show(); - var settings = { - //chart: { - // renderTo: 'querychart' - //}, - //title: { - // text: '', - // margin: 0 - //}, title: { text: '' //margin:20 }, - series: series, - //xAxis: xaxis, - //yAxis: yaxis, - //plotOptions: { - // pie: { - // allowPointSelect: true, - // cursor: 'pointer', - // dataLabels: { - // enabled: true, - // distance: 35, - // formatter: function() { - //return ''+ this.point.name +'
'+ Highcharts.numberFormat(this.percentage, 2) +' %'; - // } - // } - // } - //}, - //tooltip: { - // formatter: function() { - // if(this.point.name) return ''+this.series.name+'
'+this.point.name+'
'+this.y; - // return ''+this.series.name+'
'+this.y; - // } - //} + //series: series, }; + if (passedNonJqplotSettings.chart.type == 'bar') { + settings.seriesDefaults = { + renderer: $.jqplot.BarRenderer, + rendererOptions: { + barDirection: 'vertical', + highlightMouseOver: true + } + }; + settings.axes = { + xaxis: { + renderer: $.jqplot.CategoryAxisRenderer + }, + yaxis: { + renderer: $.jqplot.CategoryAxisRenderer + } + }; + } if (passedNonJqplotSettings.chart.type == 'pie') { //settings.tooltip.formatter = function() { return ''+columnNames[0]+'
'+this.y; } } // Overwrite/Merge default settings with passedsettings $.extend(true, settings, passedSettings); - //return PMA_createChart(settings); $.jqplot('querychart', series[0].data, settings); }