From 6022332f5e673e6f6226a3332393671946ebe503 Mon Sep 17 00:00:00 2001 From: Mathieu Cottet Date: Thu, 11 Oct 2012 11:52:36 +0200 Subject: [PATCH 1/2] Some more options to use spiderweb graph and polar chart (need to include highcharts-more.js) * data-graph-polar "true" to render a polar graph. Default: undefined * data-graph-yaxis-{X}-grid-line-interpolation Define the graph type. Default: null ex: "polygon" to get a spiderweb graph * data-graph-xaxis-show-last-label If you have a number on the last label, put it to false. Default: true * tickmarkPlacement For categorized axes only. If "on" the tick mark is placed in the center of the category, if "between" the tick mark is placed between categories. default: "on" * data-graph-xaxis-gridLine-width The width of the grid lines extending the ticks across the plot area. Default: 0 --- jquery.highchartTable.js | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/jquery.highchartTable.js b/jquery.highchartTable.js index 52b5cb5..138f5a7 100644 --- a/jquery.highchartTable.js +++ b/jquery.highchartTable.js @@ -128,7 +128,7 @@ var vlinex = $th.data('graph-vline-x'); if (typeof vlinex == 'undefined') { thGraphConfig.scale = typeof columnScale != 'undefined' ? parseFloat(columnScale) : 1; - thGraphConfig.graphType = serieGraphType == 'column' && isGraphInverted ? 'bar' : serieGraphType;; + thGraphConfig.graphType = serieGraphType == 'column' && isGraphInverted ? 'bar' : serieGraphType; thGraphConfig.stack = serieStackGroup; thGraphConfig.unit = $th.data('graph-unit'); columns[indexTh] = thGraphConfig; @@ -283,7 +283,8 @@ endOnTick: $table.data('graph-yaxis-'+yAxisNum+'-end-on-tick') !== "0", stackLabels : { enabled: $table.data('graph-yaxis-'+yAxisNum+'-stacklabels-enabled') == '1' - } + }, + gridLineInterpolation: $table.data('graph-yaxis-'+yAxisNum+'-grid-line-interpolation') || null }; var callableYAxisFormatter = getCallable(table, 'graph-yaxis-'+yAxisNum+'-formatter-callback'); @@ -344,7 +345,8 @@ marginLeft: typeof marginLeft != 'undefined' ? marginLeft : null, spacingTop: $table.data('graph-spacing-top') || 10, height: $table.data('graph-height') || null, - zoomType: $table.data('graph-zoom-type') || null + zoomType: $table.data('graph-zoom-type') || null, + polar: $table.data('graph-polar') ? $table.data('graph-polar') : undefined }, title: { text: graphTitle @@ -364,7 +366,7 @@ type: ($table.data('graph-xaxis-type') == 'datetime') ? 'datetime' : undefined, reversed: $table.data('graph-xaxis-reversed') == '1', opposite: $table.data('graph-xaxis-opposite') == '1', - showLastLabel: true, + showLastLabel: typeof $table.data('graph-xaxis-show-last-label') != 'undefined' ? $table.data('graph-xaxis-show-last-label') : true, tickInterval: $table.data('graph-xaxis-tick-interval') || null, dateTimeLabelFormats: { //by default, we display the day and month on the datetime graphs second: '%e. %b', @@ -391,7 +393,9 @@ text: $table.data('graph-xaxis-title-text') || null }, gridLineWidth: $table.data('graph-xaxis-gridLine-width') || 0, - gridLineDashStyle: $table.data('graph-xaxis-gridLine-style') || 'ShortDot' + gridLineDashStyle: $table.data('graph-xaxis-gridLine-style') || 'ShortDot', + tickmarkPlacement: 'on', + lineWidth: $table.data('graph-xaxis-line-width') || 0 }, yAxis: yAxisConfig, tooltip: { From 59c29f51a8157734e7c62c011aec207e233f73f0 Mon Sep 17 00:00:00 2001 From: Mathieu Cottet Date: Tue, 16 Oct 2012 14:33:20 +0200 Subject: [PATCH 2/2] Use default values of highcharts for polar and tickmarkPlacement options --- jquery.highchartTable.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/jquery.highchartTable.js b/jquery.highchartTable.js index 138f5a7..5a58e4f 100644 --- a/jquery.highchartTable.js +++ b/jquery.highchartTable.js @@ -346,7 +346,7 @@ spacingTop: $table.data('graph-spacing-top') || 10, height: $table.data('graph-height') || null, zoomType: $table.data('graph-zoom-type') || null, - polar: $table.data('graph-polar') ? $table.data('graph-polar') : undefined + polar: $table.data('graph-polar') || null }, title: { text: graphTitle @@ -394,7 +394,7 @@ }, gridLineWidth: $table.data('graph-xaxis-gridLine-width') || 0, gridLineDashStyle: $table.data('graph-xaxis-gridLine-style') || 'ShortDot', - tickmarkPlacement: 'on', + tickmarkPlacement: $table.data('graph-xaxis-tickmark-placement') || 'between', lineWidth: $table.data('graph-xaxis-line-width') || 0 }, yAxis: yAxisConfig,