This is a tricky one. The problem here is that you need to figure out some combination of minimum value, maximum value, and count of gridlines for the hAxis that ends up with a gridline naturally aligning with the value 700000. That is not a trivial problem to solve for a logScale axis. Given a = minimum data value, b = baseline, c = maximum data value, solve for integers k, l, m, and n, such that:
0 <= k <= a l >= c k and l fall on "nice" values (values that the API deems fit for display, eg 100000 is a nice value, 127789 is not) 0 <= n <= m log(k) + n * ((log(l) - log(k)) / m) = log(b) and for all integer values o, where 0 <= o <= m, p is a "nice" value: p = o * ((log(l) - log(k)) / m) Two equations with 7 variables and some constraints. You know your baseline value, but that still requires solving a 6-dimensional problem to get the rest of the values, and in the end, I'm not sure that you are guaranteed to have a solution that satisfies all conditions. On Wednesday, June 12, 2013 11:03:54 PM UTC-4, [email protected] wrote: > > You can try next in google playground it is not working > > function drawVisualization() { > // Create and populate the data table. > var data = google.visualization.arrayToDataTable([ > ['Year', 'Austria', 'Bulgaria', 'Denmark', 'Greece'], > ['2003', 1336060, 400361, 1001582, 997974], > ['2004', 1538156, 366849, 1119450, 941795], > ['2005', 1576579, 440514, 993360, 930593], > ['2006', 1600652, 434552, 1004163, 897127], > ['2007', 1968113, 393032, 979198, 1080887], > ['2008', 1901067, 517206, 916965, 1056036] > ]); > > // Create and draw the visualization. > new google.visualization.BarChart(document.getElementById( > 'visualization')). > draw(data, > {title:"Yearly Coffee Consumption by Country", > width:600, height:400, > vAxis: {title: "Year"}, > hAxis: {title: "Cups",'baseline': 700000,'logScale':true}} > ); > } > > Четвер, 13 червня 2013 р. 00:53:04 UTC+3 користувач [email protected] написав: >> >> Hi. >> >> I'm using google bar chart with baseline. >> It works good but label with baseline value isn't displayed. >> Are there any configuration options for this problem, or I should look >> for some hacks? >> Also in case when I'm using logScale is there the same ability to show >> value for baseline? >> >> Thanks! >> >> -- 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. For more options, visit https://groups.google.com/groups/opt_out.
