[visualization-api] Re: Same width for each bar
If you use Date objects, you can set the format of the tooltips and axis labels to different patterns to get the effect you want: var data = google.visualization.arrayToDataTable([ ['Date', 'Value1', 'Value2', 'Value3', 'Value4'], [new Date(2014, 6, 1), 1336060, 400361, 1001582, 997974], [new Date(2014, 6, 3), 1538156, 366849, 1119450, 941795], [new Date(2014, 6, 5), 1576579, 440514, 993360, 930593], [new Date(2014, 6, 9), 1600652, 434552, 1004163, 897127], [new Date(2014, 6, 10), 1968113, 393032, 979198, 1080887], [new Date(2014, 6, 11), 1901067, 517206, 916965, 1056036] ]); // format dates as /MM/dd // eg: new Date(2014, 6, 1) = 2014/07/01 var formatter = new google.visualization.DateFormat({pattern: '/MM/dd'}); formatter.format(data, 1); The formatter takes care of the tooltip display. You can then change the axis values by setting the hAxis.format option: hAxis: { format: 'd' } Note that javascript uses a 0-based index for months, so January is 0, not 1, so input your dates accordingly. On Tuesday, September 9, 2014 9:20:11 AM UTC-4, Schabagh wrote: Hello Andrew, thanks for your reply. I get the chart data form a database like this: Case 1 (my first post): var data = google.visualization.arrayToDataTable([ ['Date', 'Value1', 'Value2', 'Value3', 'Value4'], ['2009/07/01', 1336060,400361,1001582, 997974], ['2009/07/03', 1538156,366849,1119450, 941795], ['2009/07/05', 1576579,440514,993360,930593], ['2009/07/09', 1600652,434552,1004163, 897127], ['2009/07/10', 1968113,393032,979198,1080887], ['2009/07/11', 1901067,517206,916965,1056036] ]); Case 2 (my second post): I get the day : timeStamp.getUTCDate().toString(); and then save the data in a DataTable as String: var data = google.visualization.arrayToDataTable([ ['Date', 'Value1', 'Value2', 'Value3', 'Value4'], ['1', 1336060,400361,1001582, 997974], ['3', 1538156,366849,1119450, 941795], ['5', 1576579,440514,993360,930593], ['9', 1600652,434552,1004163, 897127], ['10', 1968113,393032,979198,1080887], ['11', 1901067,517206,916965,1056036] ]); In Case1 I have the whole Date in my tooltip-Window in Case2 only the days. I think I have also a problem with the indicate of chart under IE (10). As you see my chart has no gridline at the point 3000 (second post). Sometimes several gridlines are missing . Thanks Am Dienstag, 9. September 2014 14:51:56 UTC+2 schrieb Andrew Gallant: If you post some sample code I can use to replicate the chart, I will see what I can do to figure out what you need to change. On Tuesday, September 9, 2014 8:10:11 AM UTC-4, Schabagh wrote: Hi, I have solved the problem with the Day of Date. I have saved the day instead of whole date in my DataTable as string. But I have now the same day on my tooltip and not the whole Date. Is there another solution for my problem? Thamks Am Dienstag, 9. September 2014 12:14:44 UTC+2 schrieb Schabagh: Hi, My X-Axis shows always bars for 31 days. I would like: 1. that my x-Axis shows the title like this: 1 2 3 4 ... 28 29 30 31 instead of 08.06.2014, also only the days for each bar. 2. I have a problem with the width of bars in my Column Chart. I would like to have the bars with the same width. But as you see I have two bar charts with different bar width and irregular spaces. 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
[visualization-api] Re: Same width for each bar
Hi, I have solved the problem with the Day of Date. I have saved the day instead of whole date in my DataTable as string. But I have now the same day on my tooltip and not the whole Date. Is there another solution for my problem? Thamks Am Dienstag, 9. September 2014 12:14:44 UTC+2 schrieb Schabagh: Hi, My X-Axis shows always bars for 31 days. I would like: 1. that my x-Axis shows the title like this: 1 2 3 4 ... 28 29 30 31 instead of 08.06.2014, also only the days for each bar. 2. I have a problem with the width of bars in my Column Chart. I would like to have the bars with the same width. But as you see I have two bar charts with different bar width and irregular spaces. 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
[visualization-api] Re: Same width for each bar
If you post some sample code I can use to replicate the chart, I will see what I can do to figure out what you need to change. On Tuesday, September 9, 2014 8:10:11 AM UTC-4, Schabagh wrote: Hi, I have solved the problem with the Day of Date. I have saved the day instead of whole date in my DataTable as string. But I have now the same day on my tooltip and not the whole Date. Is there another solution for my problem? Thamks Am Dienstag, 9. September 2014 12:14:44 UTC+2 schrieb Schabagh: Hi, My X-Axis shows always bars for 31 days. I would like: 1. that my x-Axis shows the title like this: 1 2 3 4 ... 28 29 30 31 instead of 08.06.2014, also only the days for each bar. 2. I have a problem with the width of bars in my Column Chart. I would like to have the bars with the same width. But as you see I have two bar charts with different bar width and irregular spaces. 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.
[visualization-api] Re: Same width for each bar
Hello Andrew, thanks for your reply. I get the chart data form a database like this: Case 1 (my first post): var data = google.visualization.arrayToDataTable([ ['Date', 'Value1', 'Value2', 'Value3', 'Value4'], ['2009/07/01', 1336060,400361,1001582, 997974], ['2009/07/03', 1538156,366849,1119450, 941795], ['2009/07/05', 1576579,440514,993360,930593], ['2009/07/09', 1600652,434552,1004163, 897127], ['2009/07/10', 1968113,393032,979198,1080887], ['2009/07/11', 1901067,517206,916965,1056036] ]); Case 2 (my second post): I get the day : timeStamp.getUTCDate().toString(); and then save the data in a DataTable as String: var data = google.visualization.arrayToDataTable([ ['Date', 'Value1', 'Value2', 'Value3', 'Value4'], ['1', 1336060,400361,1001582, 997974], ['3', 1538156,366849,1119450, 941795], ['5', 1576579,440514,993360,930593], ['9', 1600652,434552,1004163, 897127], ['10', 1968113,393032,979198,1080887], ['11', 1901067,517206,916965,1056036] ]); In Case1 I have the whole Date in my tooltip-Window in Case2 only the days. I think I have also a problem with the indicate of chart under IE (10). As you see my chart has no gridline at the point 3000 (second post). Sometimes several gridlines are missing . Thanks Am Dienstag, 9. September 2014 14:51:56 UTC+2 schrieb Andrew Gallant: If you post some sample code I can use to replicate the chart, I will see what I can do to figure out what you need to change. On Tuesday, September 9, 2014 8:10:11 AM UTC-4, Schabagh wrote: Hi, I have solved the problem with the Day of Date. I have saved the day instead of whole date in my DataTable as string. But I have now the same day on my tooltip and not the whole Date. Is there another solution for my problem? Thamks Am Dienstag, 9. September 2014 12:14:44 UTC+2 schrieb Schabagh: Hi, My X-Axis shows always bars for 31 days. I would like: 1. that my x-Axis shows the title like this: 1 2 3 4 ... 28 29 30 31 instead of 08.06.2014, also only the days for each bar. 2. I have a problem with the width of bars in my Column Chart. I would like to have the bars with the same width. But as you see I have two bar charts with different bar width and irregular spaces. 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 google-visualization-api+unsubscr...@googlegroups.com. To post to this group, send email to google-visualization-api@googlegroups.com. Visit this group at http://groups.google.com/group/google-visualization-api. For more options, visit https://groups.google.com/d/optout.