I have a fix for this frequently encountered problem of using continuous value domain axes with column, bar, and candlestick charts. It first finds the minimum space between any two values, and expands the data values by half of that minimum space. It lets you expand further with the minValue and maxValue, and also works with a viewWindow min or max which might shrink or expand the view, so your workarounds should continue to work.
We should be releasing a version with this fix in about a month or two. dan On Thursday, June 28, 2012 1:23:14 PM UTC-4, asgallant wrote: > > That is a side effect of using a continuous axis with column charts. The > bars are centered on the data point, so the first and last data points have > their bars cut off unless you expand the axis range. Set > hAxis.viewWindowMode to 'explicit' and set the 'min' and 'max' properties > of hAxis.viewWindow to values below and above, respectively, the minimum > and maximum axis values. > > The charts should probably default to expanding the axis large enough to > include all of the bars, though, so you might want to file a report on > this: http://code.google.com/p/google-visualization-api-issues/issues/list > > > On Thursday, June 28, 2012 1:06:15 PM UTC-4, SherCoder wrote: >> >> The issue with corechart I get is it does not display the bars on both >> ends of the chart. The reason I was using columnchart is because it works >> fine with chrome and firefox. I just added a bigger picture. here is the >> code that I am using: >> >> >> >> <script type='text/javascript'> >> if ($.browser.msie) { >> google.load('visualization', '1', { 'packages': ['corechart'] >> }); >> } >> else { >> google.load('visualization', '1', { 'packages': >> ['columnchart'] }); >> } >> google.setOnLoadCallback(drawSizeChart); >> >> function drawSizeChart() { >> $.post('/metrics/SiteResourceChart', { fnsId: "@Model.FnsId", >> regionId: selectedValue }, >> function (data) { >> if (Object.keys(data).length !== 0) { >> var tdata = new google.visualization.DataTable(); >> >> tdata.addColumn('date', 'Date'); >> for (var p = 0; p < data.allPaths.length; ++p) { >> tdata.addColumn('number', >> data.allPaths[p].PathName); >> } >> >> var index = 0; >> for (var i = 0; i < data.allDates.length; ++i) { >> var loadrow = []; >> var date = new >> Date(parseInt(data.allDates[i].CreatedAt.substr(6))); >> loadrow[0] = date; >> for (var j = 1; j < data.allPaths.length + 1; >> ++j, ++index) { >> loadrow[j] = data.allLoadTimes[index]; >> } >> tdata.addRow(loadrow); >> } >> >> var options = { >> title: 'Page Load Resource Count (Last 7 >> Days)', >> titleTextStyle: { fontSize: 20 }, >> bar: { groupWidth: '25%' }, >> hAxis: { format: 'MMM d' }, >> hAxis: { viewWindowMode: 'maximized' } >> >> }; >> >> var chart = new >> google.visualization.ColumnChart(document.getElementById('site_size_chart')); >> chart.draw(tdata, options); >> } >> } >> ); >> } >> </script> >> >> On Wednesday, June 27, 2012 4:24:35 PM UTC-7, SherCoder wrote: >>> >>> I am trying to display column chart in IE. It crops the bars from both >>> ends of the chart in IE9. I know the data is there because i am testing it >>> with other browsers. >>> >>> This <http://tinypic.com/r/a0cajk/6> is the link to the image of how >>> the graph looks. >>> >>> Any help would be really appreciated. >>> >>> P.S. I have attached the code that I am using to display this chart >>> >> -- You received this message because you are subscribed to the Google Groups "Google Visualization API" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/google-visualization-api?hl=en. For more options, visit https://groups.google.com/groups/opt_out.
