Re: Setting a default chart

24 views
Skip to first unread message

asgallant

unread,
Aug 13, 2013, 12:13:08 PM8/13/13
to google-visua...@googlegroups.com
The answer to your question is probably yes, but I need some more information in order to help you figure out exactly what you need to do.  Does your page have some way of selecting different charts, or narrowing the data within the chart?  Example code showing the problem you are facing would be helpful.

On Tuesday, August 13, 2013 9:38:27 AM UTC-4, kpj wrote:
Hi ,
I would like to set a default chart in my page.
right now, when the page opens up, the Yaxis looks messy because i have huge data, all the labels in the yaxis are overlapping..
so, i would like to put a default chart .. is that possible?
Thanks in advance

asgallant

unread,
Aug 13, 2013, 1:09:26 PM8/13/13
to google-visua...@googlegroups.com
You can set a default region or country by setting the respective controls' "state.selectedValues" parameter.  As an example, if the region is North America, you would set the region selector's "state" parameter as:

state: {
    selectedValues: ['Amer No']
}

On Tuesday, August 13, 2013 12:44:26 PM UTC-4, kpj wrote:
Thanks for looking at it.
Please find the picture of charts in the attachment.
My aim is to populate the region and country control wrappers with the placemark information..by doing that, when i open the balloon , the default chart would be the values for that particular placemark.
Please find my kml file in the attachment..
I am attaching a kml file , because the code might require some more information about the placemark.
Thanks for helping me out.

asgallant

unread,
Aug 13, 2013, 2:33:48 PM8/13/13
to google-visua...@googlegroups.com
Are you looking to have the data aggregated at the region level and then charted?

On Tuesday, August 13, 2013 1:59:03 PM UTC-4, kpj wrote:
Well, There is a limitation to do that, as i want to get the click of google earth placemark to instantiate this. So, i would like to have a default chart that shows the information of the region( if i have 4 regions, i need to have a default chart that shows 4 regions in the vaxis and related information plotted.)
Can we do that? please advice.Thanks

asgallant

unread,
Aug 13, 2013, 6:50:05 PM8/13/13
to google-visua...@googlegroups.com
Ok, that is going to be a bit more involved, since you need to group the data by the region using google.visualization.data.group.  The tricky part is that you have to switch to the DataTable used when someone selects a region or a country.

On Tuesday, August 13, 2013 6:05:10 PM UTC-4, kpj wrote:
Yes, exactly and i want that chart to be shown when ever we open the balloon..
 
Thanks for looking into it..

asgallant

unread,
Aug 14, 2013, 1:04:33 AM8/14/13
to google-visua...@googlegroups.com
The simple solution is to set the starting state of the controls, as I posted above, but that doesn't give you the aggregated view.

On Tuesday, August 13, 2013 7:54:05 PM UTC-4, kpj wrote:
Do you suggest any alternative to the existing one, which looks messier on the vaxis.?


--
You received this message because you are subscribed to a topic in the Google Groups "Google Visualization API" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/google-visualization-api/V9uKfRmcWL4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Message has been deleted

asgallant

unread,
Aug 15, 2013, 12:19:42 AM8/15/13
to google-visua...@googlegroups.com
You are missing the comma before the "state" parameter:

var regionPicker = new google.visualization.ControlWrapper({
    'controlType': 'CategoryFilter',
    'containerId': 'control1',
    'options': {
        'filterColumnLabel': 'Region',
        'ui': {
            'labelStacking': 'vertical',
            'allowTyping': false,
            'allowMultiple': false,
            //selectedValuesLayout: 'belowStacked'
        }
    },
    state: {
        selectedValues: [dataArray.getValue(defaultRow, regionColumn)]
    }
});


On Wednesday, August 14, 2013 12:47:29 PM UTC-4, kpj wrote:
Please find my updated code in the attachment..
I am getting an uncaught syntax error at state:{ line..
THe syntax seems to be right.
 
Thanks for your help

On Tuesday, August 13, 2013 8:38:27 AM UTC-5, kpj wrote:
Reply all
Reply to author
Forward
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
Message has been deleted
0 new messages