From 3d29155a8094ae3f8864d7c689b4e280a414b60e Mon Sep 17 00:00:00 2001 From: Aysam Guerler Date: Wed, 18 Jun 2014 06:42:11 -0400 Subject: [PATCH] Charts: Fix jqplot bar axis --- .../charts/static/charts/jqplot/bar/wrapper.js | 7 ++++++- .../charts/static/charts/jqplot/common/plot-config.js | 5 ++--- .../charts/static/charts/jqplot/common/wrapper.js | 2 +- .../plugins/visualizations/charts/static/charts/tools.js | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/bar/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/bar/wrapper.js index 01981839619..479126bb1a7 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/bar/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/bar/wrapper.js @@ -20,7 +20,12 @@ return Backbone.View.extend( makeConfig : function(groups, plot_config){ $.extend(true, plot_config, { seriesDefaults: { - renderer : $.jqplot.BarRenderer + renderer : $.jqplot.BarRenderer + }, + axes: { + xaxis: { + min : -1 + } } }); } diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/common/plot-config.js b/config/plugins/visualizations/charts/static/charts/jqplot/common/plot-config.js index dc2f9bb81bf..27f589b475b 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/common/plot-config.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/common/plot-config.js @@ -16,8 +16,8 @@ return function(chart) { showLine : true, // whether to render the line segments or not. rendererOptions: { shadowDepth : 0, - //barDirection : 'horizontal', - barWidth : 1 + barWidth : 3, + barPadding : 3 }, markerRenderer : $.jqplot.MarkerRenderer, markerOptions: { @@ -56,7 +56,6 @@ return function(chart) { angle : chart.settings.get('use_panels') === 'true' ? 0 : -30, showGridline : chart.settings.get('x_axis_grid') === 'true' }, - tickInterval : 1, pad : 0 }, yaxis: { diff --git a/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js b/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js index 7e7447d81dc..4f0d8ea70ee 100644 --- a/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js +++ b/config/plugins/visualizations/charts/static/charts/jqplot/common/wrapper.js @@ -134,7 +134,7 @@ return Backbone.View.extend( formatter : function(formatter) { if (formatter) { plot_config.axes[id + 'axis'].tickOptions.formatter = function(format, value) { - return formatter(value); + return formatter(value); }; } } diff --git a/config/plugins/visualizations/charts/static/charts/tools.js b/config/plugins/visualizations/charts/static/charts/tools.js index b4a8126a0a2..9386a503446 100644 --- a/config/plugins/visualizations/charts/static/charts/tools.js +++ b/config/plugins/visualizations/charts/static/charts/tools.js @@ -361,6 +361,9 @@ function addZoom(options) { // add handler svg.call(d3zoom).on('dblclick.zoom', unzoomed); + + // return + return d3zoom; }; // return