Hi Rivka,

If you use html tooltips, the contents can be computed dynamically if you
handle the 'onmouseover' event in your chart.  Since there really is only
one actual tooltip element, and the contents will be populated by your
custom tooltip text, what you could do is just specify a div with an id
like this, using a view where you set the columns:

    var myDataView = new google.visualization.DataView(myData);
    var columns = [ .. other columns ];

    columns.push({
        type: 'string',
        role: 'tooltip',
        properties: {html: true},
        calc: function(data, row) {
            var s = String(data.getValue(row, 1));
            return '<div id="tooltip_chart_div"' +
                ' style="width: 175px; height: 150px"></div>';
        }
    });

    myDataView.setColumns(columns);

Then in your 'onmousover' handler, you can do something like this to
display a BarChart in the div:

    var container = document.getElementById('tooltip_chart_div');
    if (!container) { return }

    var tooltipChart = new google.visualization.BarChart(container);
    ...
    tooltipChart.draw(barData, barOptions);

Hope that helps.




On Sun, Nov 29, 2015 at 7:34 AM, Rivka <[email protected]> wrote:

> We have a chart with around 500 points and a custom tooltip function that
> takes 2 msec to run.
> As a consequence, there is a penalty of 1000 msec on chart rendering.
>
> Is there a way to be lazy on tooltip calculation and call the function
> only upon user interaction?
>
> Or maybe there are other way to be more efficient?
>
> --
> 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.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/google-visualization-api/f5ddf401-b3a1-4bd2-9a7f-5760bf9e8eed%40googlegroups.com
> <https://groups.google.com/d/msgid/google-visualization-api/f5ddf401-b3a1-4bd2-9a7f-5760bf9e8eed%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2>  -
978-394-1058
[email protected] <[email protected]>   5CC, Cambridge MA
[email protected] <[email protected]> 9 Juniper Ridge
Road, Acton MA

-- 
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.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-visualization-api/CAOtcSJPiKDQr3v0s%2BE8__seC6RjRFgMJrWihUFLFznZwh1japw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to