I'm using Google Charts to print out some cool charts. It works great in all my browsers.
But the application that I'm building is a HbbTv app. In that enviroment Google Charts gives me an error when he tries to create a DataTable.
The google.visualization object exist, but arrayToTable doesn't exist...
When I try to use DataTable() (creating a new empty DataTable) I get an error dat new google.visualization.DataTable() isn't a constructor...
Somebody known how this could happen?
Some additional info:
The google.visualisation is loaded (but it only count 3 elements instead of 51)
The HbbTv enviroment is a Opera 9.8
Thanks!
Code:
//My code for creating a data table from an array
var dataTable = google.visualization.arrayToDataTable(data, false);
// My code for creating a DataTable with a new instance
var dataTable = new google.visualization.DataTable();
dataTable.addColumn('string', 'Hour');
dataTable.addColumn('number', 'Amount');
dataTable.addColumn('number', 'Average');
dataTable.addRows(data);
The problem is fixed in the Google Visualization 1.1 (release canidate).
So very soon it will be fixed in the production version.
Related
I’m struggling to obtain the new value that is being set in an editable Interactive Grid. I’ve created a dynamic action to be fired when the column has changed. The dynamic action is firing as expected, but it’s returning the previous value and not the value that triggered the event.
The dynamic action is set to execute JavaScript:
var $te = $(this.triggeringElement);
var rowID = $te.closest('tr').data('id');
var grid = apex.region('IG_SCALE_1').call('getViews','grid');
var model = grid.model;
var record = model.getRecord(rowID);
var column_val = model.getValue(record,”COLUMN_1”);
apex.item(“P1_HIDDEN_1”).setValue(column_val);
Let’s say column_1 had a value of 0 and that value was changed to 1. The code is setting the hidden item’s value to 0. I need it to be set to 1.
When I execute the following code I can see the old value in the array.
console.log(record);
Is there anything that I can do to obtain the new value?
Many thanks.. let me know if you have any questions!
You might be encountering one of the bugs, which are fixed in APEX version 19.2.
John Snyders described in his blog APEX IG Cookbook update for 19.2
One of the bugs had to do with changes to the last edited cell not always being saved.
A list of all fixed bugs in 19.2 is available here: APEX 19.2 Release Notes.
Search for 26963177 and 29132960 in particular.
Can you reproduce the issue in apex.oracle.com environment?
In a project I am working on tracking click events is done by the following code:
var goal = new PageEventItem(goalItem);
var eventRow = Tracker.Current.Interaction.CurrentPage.Register(goal);
eventRow.DataKey = ID;
eventRow.Data = NAME;
eventRow.Text = DATA;
This will be recorded to the interactions table on MongoDB, What I need know is to create a report that display these registered data? so my question is how I can read these data from MongoDb?
Approach to build reports on data directly from MongoDB will not work well on big amount of records.
You should take a look in a direction how to aggregate your data in Reporting DB and build report using it.
If you really need to look at the live data in MongoDb you could try using a third party tool like SlamData - http://slamdata.com/get-slamdata/slamdata-for-mongodb/
This would also give you the ability to produce charts from your MongoDb data. However the data wouldn't be available from within the Sitecore shell.
If you can wait for the data to be aggregated then go with Antons suggestion below.
I create an rally taskboard app by using the following source code: https://github.com/RallyApps/app-catalog/tree/master/src/apps/taskboard
Now I want to set default value for collapsed property in rowConfig but it is not working. otherwise when I use setCollapsed for all rows by using this code:
var rows = this.down('rallycardboard').getRows();
rows[0].setCollapsed(true);
It's not working too. Anyone help me? Thanks
There is not currently a configuration property for controlling whether a row is expanded or collapsed on load (although they do remember their collapsed state once they are manually clicked on to collapse).
However you should be able to collapse them on load using code very similar to what you have above:
var board = this.down('rallycardboard'),
rows = board.getRows();
rows[0].collapse();
I created a line chart using google visualization.
The code queries a google spreadsheet.
When I use a normal spreadsheet (line 1), it works.
When I use a new google spreadsheet (URL on line 2) I have this error:
Error in query: request time out
I have the following two queries with two different URL: the first working, the second no.
var query = new google.visualization.Query('http://spreadsheets.google.com/tq?key=0AgtmZPWzQ7lldEt2S2VLajBRQVNFLV9pRFY2bTRQLVE&transpose=0&headers=1&merge=COLS&range=E2%3AE64%2CF2%3AJ64&gid=0&pub=1', opts);
var query = new google.visualization.Query('http://spreadsheets.google.com/tq?key=1chFDkz5Fqus1ODgtdEGNt4Mq2nxnkKnuqbEB4LaZF6o&transpose=0&headers=1&merge=COLS&range=A1%3AA100%2CB1%3AF100&gid=0&pub=1', opts);
I played with the URL to find the right format. I am wondering if I cannot find the right format, or if the new google sheets do not work or work differently with queries.
If I just put the URL in a browser:
http://spreadsheets.google.com/tq?key=1chFDkz5Fqus1ODgtdEGNt4Mq2nxnkKnuqbEB4LaZF6o
It says the file does not exist (in the second case only, with the new google sheet)
This is the link to the spreadsheet:
new google spreadsheet (second one)
It seems one possible solution (from a google spreadsheet project team member) is to use:
"https://docs.google.com/spreadsheets/d/{key}/gviz/tq"
Basically, use "docs" instead of "spreadsheets" and add "/gviz/tq" to the end.
In my example, that would be:
https://docs.google.com/spreadsheets/d/1chFDkz5Fqus1ODgtdEGNt4Mq2nxnkKnuqbEB4LaZF6o/gviz/tq
I am creating a markers-based Geochart to display the location of schools. I have my data in a Google docs spreadsheet. I'm using 3 columns: lat, long and marker size. Currently, the tooltips display lat and long. Ideally, they would display information about each school instead but removing them would be fine, too. See what I have so far on jsfiddle.
Some of the other Google visualizations seem to allow a trigger:'none' option for tooltip (e.g., Pie Chart). Am I correct that there is no such thing for GeoChart?
It seems there's an experimental feature that allows assigning a tooltip role to a particular data column. I tried to use that to no avail.
I tried finding and hiding the tooltip div but I couldn't figure out how to access any elements in the iframe that contains the map. I'd be perfectly happy with this kind of solution if I could get it to work!
I realize this is not exactly what Geochart seems meant for but I'm using other Geochart region maps on the same page and would like to keep the same aesthetic.
I know this is an old question, but maybe it can still help.
Check out this example:
data.addColumn('number', 'Lat');
data.addColumn('number', 'Long');
data.addColumn('string','tooltip');
data.addColumn('number','Example');
data.addRows([[41.151636,-8.569336,'Portugal',{v:0,f:'test PT'}]]);
data.addRows([[ 39.059575,-98.789062,'USA',{v:1,f:'test US'}]]);
You can now also disable the tooltip adding, which was not previously available:
tooltip.trigger:'none';
Here is an example: http://jsfiddle.net/cmoreira/njB6m/