And now, It works! Thank you very much!!

On Tuesday, 14 May 2013 20:19:29 UTC+2, asgallant wrote:
>
> If you use focusTarget "category", you have to assign the tooltip to your 
> domain column, not the data columns, ie:
>
> var data2 = new google.visualization.DataTable();
> data2.addColumn('number', 'Year');
> // A column for custom tooltip content
> data2.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': 
> true}});
> data2.addColumn('number', 'Amount');
>
> ...
>
>
> data2.addRow([parseFloat(ret[i]), createCustomHTMLContent(ret[i]), 
> getAmount(parseFloat(ret[i]))]); 
>
> Since you only have 1 data series here, it might just be easier to get rid 
> of the focusTarget "category" option.
>
> On Tuesday, May 14, 2013 10:57:26 AM UTC-4, Gabriele Barni wrote:
>>
>> Here I am again,
>>
>> I am implementing a Combochart, and I want to set a tooltip using the 
>> functionality by HTML. This is my code :
>>
>>
>> var data2 = new google.visualization.DataTable();
>> data2.addColumn('number', 'Year');
>> data2.addColumn('number', 'Amount');
>> // A column for custom tooltip content
>> // data2.addColumn({type: 'string', role: 'tooltip'});
>> // Use custom HTML content for the domain tooltip.
>> data2.addColumn({'type': 'string', 'role': 'tooltip', 'p': {'html': 
>> true}}); for (var i=0; i < ret.length; i++) 
>> { 
>> if(parseFloat(ret[i]) != 0){ 
>> //alert(getAmount(parseFloat(window.result[i][0]), data2)); 
>> data2.addRow( [parseFloat(ret[i]), 
>> getAmount(parseFloat(ret[i])), 
>> createCustomHTMLContent(ret[i]) ] ); 
>> } 
>> } 
>> var options2 = { 
>> // This line makes the entire category's tooltip active. 
>> focusTarget: 'category', 
>> // Use the new HTML tooltip (default SVG one does not support HTML 
>> content). 
>> tooltip: { isHtml: true }, 
>> title : 'Monthly asd Production by Country', 
>> //vAxis: {title: "asd"}, 
>> hAxis: {title: "Year"}, 
>> seriesType: "bars", 
>> }; 
>> window.chart.draw(data2,options2); 
>> //google.visualization.events.addListe
>> function createCustomHTMLContent(date) { 
>> return '<div style="padding:5px 5px 5px 5px;">' + 
>> date + 
>> '</div>'; 
>>
>> }
>>
>>
>> But, when, on browser, the tooltip shows directly the entire HTML code 
>> and not the HTML formatted. Is there anyone who has already encountered 
>> this kind of problem ? I followed the official guide step by step!
>>
>> Thank you.
>>
>> Gabriele
>>
>

-- 
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to