Changeset 2070


Ignore:
Timestamp:
Oct 27, 2011, 2:01:34 PM (12 years ago)
Author:
tjeerd@…
Message:

VIS-47, advanced setting for angles x-labels added. Default value is ON

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/grails-app/views/visualize/index.gsp

    r2062 r2070  
    1515        <g:javascript src="jqplot/plugins/jqplot.canvasTextRenderer.min.js" /> 
    1616        <g:javascript src="jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js" />
     17    <g:javascript src="jqplot/plugins/jqplot.canvasAxisTickRenderer.min.js" />
    1718    <g:javascript src="jqplot/plugins/jqplot.ohlcRenderer.min.js" />
    1819    <g:javascript src="jqplot/plugins/jqplot.highlighter.min.js" />
     
    9394                                <td><input type="checkbox" name="showvalues" id="showvalues" CHECKED onClick="changeVis();"/></td>
    9495                            </tr>
     96                            <tr>
     97                                <td><label for="anglelabels">Angle labels on the x-axis.<br />(if this box is checked, labels are shown at a 45&deg; angle)</label></td>
     98                                <td><input type="checkbox" name="anglelabels" id="anglelabels" CHECKED onClick="changeVis();"/></td>
     99                            </tr>
    95100                        </table>
    96101                    </div>
  • trunk/web-app/js/visualization.js

    r2066 r2070  
    225225
    226226                var showDataValues = $("#showvalues").attr("checked")=="checked" ? true : false;
    227                
     227                var xangle = $("#anglelabels").attr("checked")=="checked" ? -45 : 0;
     228
    228229                switch( returnData.type ) {
    229230                        case "horizontal_barchart":
     
    253254                                    label: ylabel,
    254255                                    formatString:'%.2f',
    255                                     labelRenderer: $.jqplot.CanvasAxisLabelRenderer
     256                                    labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
     257                                    tickRenderer: $.jqplot.CanvasAxisTickRenderer,
     258                                    tickOptions: {
     259                                        angle: xangle
     260                                    }
    256261                                },
    257262                                yaxis: {
     
    290295                                    ticks: returnData.series[ 0 ].x,    // Use the x-axis of the first serie
    291296                                    labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
    292                                     label: xlabel
     297                                    label: xlabel,
     298                                    tickRenderer: $.jqplot.CanvasAxisTickRenderer,
     299                                    tickOptions: {
     300                                        angle: xangle
     301                                    }
    293302                                },
    294303                                yaxis: {
     
    320329                                    ticks: returnData.series[ 0 ].x,    // Use the x-axis of the first serie
    321330                                    labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
    322                                     label: xlabel
     331                                    label: xlabel,
     332                                    tickRenderer: $.jqplot.CanvasAxisTickRenderer,
     333                                    tickOptions: {
     334                                        angle: xangle
     335                                    }
    323336                                },
    324337                                yaxis: {
     
    359372                                    ticks: returnData.series[ 0 ].x,            // Use the x-axis of the first serie
    360373                                    label: xlabel,
    361                                     labelRenderer: $.jqplot.CanvasAxisLabelRenderer
     374                                    labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
     375                                    tickRenderer: $.jqplot.CanvasAxisTickRenderer,
     376                                    tickOptions: {
     377                                        angle: xangle
     378                                    }
    362379                                },
    363380                                yaxis: {
Note: See TracChangeset for help on using the changeset viewer.