Hey..
The number of rows in my table is not fixed. If i add scrolll bar in my div
after a particular height, then header bar also scrolls with rows.
If i define height in google api's option while drawing chart then that
height is always fixed and if number of rows is very less then a huge
amount of empty space is visible in table.
How can this be fixed..?
Thanks
On Tuesday, December 4, 2012 9:22:04 PM UTC+5:30, asgallant wrote:
> Printing works just like printing any other HTML - use the browser's print
> function. If you want to print just the table, there are several ways to
> do that (Google for methods). If you use export to CSV, Excel will open it
> just fine. There is no practical means to replicate the internal structure
> of an XLS file, unless you have MS Office plugged into your webserver with
> the appropriate API installed (Google for details).
>
> On Tuesday, December 4, 2012 5:19:02 AM UTC-5, Heena wrote:
>>
>> Hi...
>> Can we even 'Print' and 'Export to Excel' the various data charts on a
>> jsp/html using Google Virtualiation API itself..?
>>
>> I dint find any option for Excel, though i found that it can be exported
>> to csv easily, but i need it directly in excel(xls format).
>> For Print, I didnt found anything from API docs.
>>
>> On Friday, November 30, 2012 9:58:56 PM UTC+5:30, asgallant wrote:
>>
>>> You could try to disappear the header row with some css. Maybe
>>> something like this would work:
>>>
>>> in css:
>>>
>>> .noShow {
>>> display: none;
>>> }
>>>
>>> in javascript:
>>>
>>> sumChart.draw(groupedView, {
>>> cssClassNames: {
>>> headerRow: 'noShow'
>>> }
>>> });
>>>
>>> As far as the formatting goes, you left out the "allowHtml" option when
>>> you draw the table, which is why it isn't working.
>>>
>>> On Friday, November 30, 2012 6:11:21 AM UTC-5, Heena wrote:
>>>>
>>>> Hi again :=)
>>>>
>>>> Yes it gives me the sum, the way u suggested.
>>>> As expected below code gives me the sum for 5 columns as a 1 row table.
>>>> So, when this all is rendered in a jsp,it gives me table 1 with all rows
>>>> and below that table 2 with summed data for above table. This table 2 has
>>>> same column labels as table1, which is an issue, bcoz i just want to
>>>> display the sum for each column. Is there any way to correct that ( ijust
>>>> need the row for that table and not the headers).
>>>>
>>>> Also i am not able to format the cells for this table. Is it some thing
>>>> like setProperty() doesn't work for grouped data?
>>>>
>>>>
>>>> Here i the code snippet:**
>>>> *
>>>>
>>>> var grouped_data = google.visualization.data.group(data, [{
>>>> column: 0,type:'string',modifier:
>>>> function () {
>>>> var modifiedString="A";
>>>> return modifiedString;
>>>> }
>>>> }], [
>>>> {column: 1, type: 'number',aggregation: google.visualization.data.sum},
>>>> {column: 2, type: 'number',aggregation: google.visualization.data.sum},
>>>> {column: 3, type: 'number',aggregation: google.visualization.data.sum},
>>>> {column: 4, type: 'number',aggregation: google.visualization.data.sum},
>>>> {column: 5, type: 'number',aggregation: google.visualization.data.sum}
>>>> ]);
>>>> grouped_data.setProperty(0, 1, "style","text-align: center;");
>>>> var groupedView = new google.visualization.DataView(grouped_data);
>>>> groupedView.setColumns([1,2,3,4,5]);
>>>> var sumChart = new
>>>> google.visualization.Table(document.getElementById('summedData'));
>>>> sumChart.draw(groupedView);
>>>>
>>>> *
>>>>
>>>>
>>>>
>>>> On Thursday, November 29, 2012 12:24:15 PM UTC+5:30, asgallant wrote:
>>>>
>>>>> You can use the group function to get the sum of a column, you just
>>>>> likely need to use a modifier function on another column in the table to
>>>>> make all of the values to group by uniform.
>>>>>
>>>>> var group = google.visualization.data.group(data, [{
>>>>> column: 0, // pick something other than a column you need summed
>>>>> type: 'number',
>>>>> modifier: function () {
>>>>> // make all values the same
>>>>> return 0;
>>>>> }
>>>>> }], [{
>>>>> // you can repeat this object as many times as you like to get
>>>>> the sum of each column that you need
>>>>> column: 1, // use the index of the column to sum
>>>>> type: 'number',
>>>>> aggregation: google.visualization.data.sum
>>>>> }]);
>>>>>
>>>>> On Wednesday, November 28, 2012 11:57:22 PM UTC-5, Heena wrote:
>>>>>>
>>>>>> Thanks Asgallant.This was really helpful.
>>>>>> Also is there any way to get the sum of an entire column. I tried
>>>>>> using google.visualization.data.sum function but since it
>>>>>> implements 'group by' function, so it did not work out.
>>>>>>
>>>>>> On Thursday, November 29, 2012 3:33:13 AM UTC+5:30, asgallant wrote:
>>>>>>
>>>>>>> No, there's no way to set a property on a whole column. You can
>>>>>>> iterate over the data set easily, though:
>>>>>>>
>>>>>>> for (var i = 0; i < data.getNumberOfRows(); i++) {
>>>>>>> data.setProperty(i, column, 'className', 'myClass');
>>>>>>> }
>>>>>>>
>>>>>>> where data is your DataTable and column is the index of the column
>>>>>>> to adjust. If you have multiple columns that need adjusting, you can
>>>>>>> stick
>>>>>>> the indices in an array, and iterate over the array inside the row loop:
>>>>>>>
>>>>>>> for (var i = 0; i < data.getNumberOfRows(); i++) {
>>>>>>> for (var j = 0; j < columns.length; j++) {
>>>>>>> <span
>>>>>>> style="color:rgb(102,102,102);line-height:15px;font-family:Inconsolata,Monaco,Consolas,"Andale
>>>>>>>
>>>>>>> Mono","Bitstream Vera Sans Mono","Courier
>>>>>>> New",Courier,monospace;font-size:1...
>>>>>>> Show
>>>>>>> original<https://groups.google.com/group/google-visualization-api/msg/84721a6194b3bab?dmode=source&output=gplain&noredirect>
>>>>>>>
>>>>>>
--
You received this message because you are subscribed to the Google Groups
"Google Visualization API" group.
To view this discussion on the web visit
https://groups.google.com/d/msg/google-visualization-api/-/JG8y7eCrE1sJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-visualization-api?hl=en.