You can use the HTML tooltips, but you have to assign them to the domain 
column, not the data columns.  See example here: 
http://jsfiddle.net/asgallant/q85yL/.  Note that in the example code, there 
is very little reason to include a second domain column (I left it in for 
consistency with the code you posted, but it can be removed without 
affecting anything in the chart).

On Wednesday, March 27, 2013 6:15:41 PM UTC-4, Oliver Chang wrote:
>
> Hi,
>
> I have a question about how to customize a line chart with two series when 
> the focusTarget: "category" option is set. Is there a way to customize the 
> display of the tooltip like there is when focusTarget is set to datum? 
> Using a column set to the tooltip role doesn't seem to work since that just 
> returns the default tooltip with raw HTML, instead of the customized, 
> rendered HTML tooltip.
>
> For example, taking an example from the Data Roles docs,
>
>  google.load('visualization', '1.1', {'packages':['corechart']});
>
>  google.setOnLoadCallback(drawChart_C6);
>
>   function drawChart_C6() {
>     var data = new google.visualization.DataTable();
>     data.addColumn({type: 'string', role: 'domain'}, '2009 Quarter');
>     data.addColumn('number', '2009 Sales');
>     data.addColumn('number', '2009 Expenses');
>     data.addColumn({type: 'string', role: 'domain'}, '2008 Quarter');
>     data.addColumn('number', '2008 Sales');
>     data.addColumn('number', '2008 Expenses');
>     
>     // tooltip column
>     data.addColumn({ type: "string", role: "tooltip", p: { html: true }});
>     
>     data.addRows([
>       ['Q1 \'09', 1000, 400, 'Q1 \'08', 800, 300, "<h1>tooltip</h1>"],
>       ['Q2 \'09', 1170, 460, 'Q2 \'08', 750, 400, "<h1>tooltip</h1>"],
>       ['Q3 \'09', 660, 1120, 'Q3 \'08', 700, 540, "<h1>tooltip</h1>"],
>       ['Q4 \'09', 1030, 540, 'Q4 \'08', 820, 620, "<h1>tooltip</h1>"]
>     ]);
>
>     var chart = new google.visualization.LineChart(document.getElementById
> ('visualization'));
>     chart.draw(data, {width: 400, height: 240, legend:'right', focusTarget
> : 'category', tooltip: {isHtml: true}});
>   }
>
> Is what I'm asking possible using a category focusTarget? Thanks in 
> advance.
>

-- 
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