Issue #674 new

date axis and bar renderer

Anonymous created an issue

bars are not properly painted (bar width is oversized) when x axis is a date axis and y values are rendered by bar renderer.

here is an example:

<!DOCTYPE html> <html> <head> <title>history test chart</title> <link class="include" rel="stylesheet" type="text/css" href="dist/jquery.jqplot.min.css" /> <!--[if lt IE 9]><script language="javascript" type="text/javascript" src="dist/excanvas.js"></script><![endif]--> <script class="include" type="text/javascript" src="dist/jquery.min.js"></script> </head> <body>

<tt> note that the difference between the charts is the xaxis renderer (DateAxisRenderer / CategoryAxisRenderer) </tt>

<div id="chart1" style="height:160px; width:480px;"></div> <div id="chart2" style="height:160px; width:480px;"></div>

<script type="text/javascript"> $(document).ready(function(){ var data = [['2012-1-1',1],['2012-2-1',2],['2012-3-1',3],['2012-4-1',4]]; var plot1 = $.jqplot('chart1', [data], { series:[ { renderer:$.jqplot.BarRenderer, rendererOptions:{barPadding:0,barMargin:0}, shadow:false } ], axes:{ xaxis:{ renderer: $.jqplot.DateAxisRenderer } }, highlighter: {show: false} });

var plot2 = $.jqplot('chart2', [data], { series:[ { renderer:$.jqplot.BarRenderer, rendererOptions:{barPadding:0,barMargin:0}, shadow:false } ], axes:{ xaxis:{ renderer: $.jqplot.CategoryAxisRenderer } }, highlighter: {show: false} });

}); </script>

<!-- Don't touch this! --> <script class="include" type="text/javascript" src="dist/jquery.jqplot.min.js"></script> <!-- End Don't touch this! -->

<!-- Additional plugins go here --> <script type="text/javascript" src="dist/plugins/jqplot.dateAxisRenderer.min.js"></script> <script type="text/javascript" src="dist/plugins/jqplot.barRenderer.js"></script> <script type="text/javascript" src="dist/plugins/jqplot.highlighter.min.js"></script> <script type="text/javascript" src="dist/plugins/jqplot.cursor.min.js"></script> <script type="text/javascript" src="dist/plugins/jqplot.categoryAxisRenderer.min.js"></script> <!-- End additional plugins --> </div>
</body> </html>

Comments (1)

  1. Log in to comment