Thank you, that is very helpful! On Wed, Apr 5, 2017 at 12:13 PM, 'Daniel LaLiberte' via Google Chart API < google-chart-api@googlegroups.com> wrote:
> You can get the range of values for a column (with > datatable.getColumnRange(columnIndex) ) and use the min value for > viewWindow.min. That is probably better than setting the baseline. > > On Wed, Apr 5, 2017 at 12:02 PM, Cindy <chani...@gmail.com> wrote: > >> Is there a way to have the baseline always begin at 10 points below my >> lowest data point? >> >> On Tuesday, April 4, 2017 at 4:12:42 PM UTC-4, Daniel LaLiberte wrote: >>> >>> Hi Cindy, >>> >>> We added a heuristic a couple years ago that tries to include 0 (or >>> whatever your baseline value is) in the chart if it is 'close enough' to >>> your data. This was particularly important for bar and column charts, >>> where the length of a bar should be determined visually from the baseline. >>> The same argument applies to area and steppedArea charts, so we apply it >>> generally to all the corecharts. >>> >>> You can avoid the surprises of whether 0 is include or not by specifying >>> a viewWindow.min of 0, or whatever value you want. This also happens if >>> you specify a baseline value explicitly, rather than using the default >>> (which is 0). Doing either of these will override the automatic >>> calculation and use whatever your viewWIndow.min or baseline value says. >>> We don't have an option to calculate automatically without sometimes >>> expanding to include 0 if it is 'close enough'. >>> >>> By the way, the 'close enough' heuristic is determined by comparing the >>> data range to the distance of your data to the baseline. If the data range >>> is larger than the distance to the baseline, then it is 'close enough' to >>> include the baseline. >>> >>> >>> On Tue, Apr 4, 2017 at 3:26 PM, Cindy <chan...@gmail.com> wrote: >>> >>>> I am making a line chart with 2 number series, displaying changes in >>>> values over a period of time. >>>> >>>> See chart below: >>>> The min and max values on the vertical axis are auto calculated based >>>> on the numerical values, which is great. >>>> >>>> >>>> <https://lh3.googleusercontent.com/-kUEwtHMMPPc/WOPvr4GIGhI/AAAAAAAAApQ/h9m_SSCHVlEPhJ1roBep3JArpwGPAUT4ACLcB/s1600/GoogleLineChart1.png> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> However, when I add a specific row to my JSON data (values 100% within >>>> range to the rest of them), my min value suddenly drops to 0. >>>> See chart below: >>>> >>>> >>>> <https://lh3.googleusercontent.com/-2-8Iif3DyR0/WOPxhyFu5iI/AAAAAAAAApc/91C6M2m227IOqgeYns6scqwDlK5FKzWigCLcB/s1600/GoogleLineChart2.png> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> >>>> I've attached a sample of the JSON data and put a comment on the >>>> specific record that is causing this issue to happen. >>>> If anyone can enlighten me on what may be causing this interesting >>>> behavior, I'd love to hear feedback. >>>> >>>> The following are my custom options (note, I have a fixed min/max for >>>> the haxis, not the vaxis): >>>> var options_lines = { >>>> curveType: 'function', >>>> backgroundColor: 'transparent', >>>> chartArea: { >>>> width: '95%', >>>> height: '75%', >>>> right: 20, >>>> }, >>>> legend: { position: 'none' }, >>>> interpolateNulls: true, >>>> hAxis: { >>>> textPosition: 'bottom', >>>> format:'haa', >>>> textStyle: { >>>> color: '#b1b1b1', >>>> fontSize: 9 >>>> }, >>>> gridlines: { >>>> color: 'transparent', >>>> count: 15 >>>> }, >>>> viewWindow: { >>>> min: new Date(prevDate.getFullYear(), >>>> prevDate.getMonth(), prevDate.getDate(), 22), >>>> max: new Date(dateSelected.getFullYear(), >>>> dateSelected.getMonth(), dateSelected.getDate(), 23, 59) >>>> } >>>> }, >>>> vAxis: { >>>> textStyle: { >>>> fontSize: 11 >>>> }, >>>> } >>>> }; >>>> >>>> My code to draw the chart is: >>>> var chart_lines = new google.visualization.LineChart >>>> (document.getElementById('uniqueID')); >>>> chart_lines.draw(data, options_lines); >>>> >>>> Looking forward to hearing a helpful response! >>>> >>>> -- >>>> You received this message because you are subscribed to the Google >>>> Groups "Google Chart API" group. >>>> To unsubscribe from this group and stop receiving emails from it, send >>>> an email to google-chart-a...@googlegroups.com. >>>> To post to this group, send email to google-c...@googlegroups.com. >>>> Visit this group at https://groups.google.com/group/google-chart-api. >>>> For more options, visit https://groups.google.com/d/optout. >>>> >>> >>> >>> >>> -- >>> Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> >>> dlali...@google.com 5CC, Cambridge MA >>> >> -- >> You received this message because you are subscribed to the Google Groups >> "Google Chart API" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to google-chart-api+unsubscr...@googlegroups.com. >> To post to this group, send email to google-chart-api@googlegroups.com. >> Visit this group at https://groups.google.com/group/google-chart-api. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> > dlalibe...@google.com <dlalibe...@google.com> 5CC, Cambridge MA > > -- > You received this message because you are subscribed to the Google Groups > "Google Chart API" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to google-chart-api+unsubscr...@googlegroups.com. > To post to this group, send email to google-chart-api@googlegroups.com. > Visit this group at https://groups.google.com/group/google-chart-api. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "Google Chart API" group. To unsubscribe from this group and stop receiving emails from it, send an email to google-chart-api+unsubscr...@googlegroups.com. To post to this group, send email to google-chart-api@googlegroups.com. Visit this group at https://groups.google.com/group/google-chart-api. For more options, visit https://groups.google.com/d/optout.