Google charts tooltips number format scientific
NickName:Thomas Freiling Ask DateTime:2017-02-14T03:13:35

Google charts tooltips number format scientific

How do you set the google charts' tooltips number format to 'scientific'? I have tried the google.visualization.NumberFormat but did not have any luck. I can set the vAxis fine as shown here: chart

    $.ajax({
        url: "GetAreaChartData",
        type: "post",
        data: formContainer.serialize(),
        success: function (data) {
            var tdata = new google.visualization.DataTable();
            var rows = data.length;
            var cols = data[0].length;

            tdata.addColumn('datetime', 'DateTime');
            tdata.addColumn('number', 'Frequency Offset');


            tdata.addRows(data.length);
            for (var i = 1; i < data.length; i++) {

                tdata.setCell(i, 0, new Date(data[i][0]));
                for (var j = 1; j < cols; j++) {
                    var value = parseFloat(data[i][j]);
                    tdata.setCell(i, j, value);
                }
            }

            var options = {

                width: 900,
                height: 500,
                lineWidth: 1,
                pointSize: 0,
                legend: 'none',
                vAxis: {
                    title: "Frequency Offset",
                    format:"scientific"
                },
            };

            var formatter = new google.visualization.NumberFormat({ format: 'scientific' });
            formatter.format(tdata, 1);

            var chart = new google.visualization.ScatterChart(document.getElementById('chart_div'));
            chart.draw(tdata, options);
        },
        error: function (jqXHR, textStatus, errorThrown) {
            alert(errorThrown);
        }
    });

Copyright Notice:Content Author:「Thomas Freiling」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/42211758/google-charts-tooltips-number-format-scientific

More about “Google charts tooltips number format scientific” related questions

Google charts tooltips number format scientific

How do you set the google charts' tooltips number format to 'scientific'? I have tried the google.visualization.NumberFormat but did not have any luck. I can set the vAxis fine as shown here: chart...

Show Detail

Google Charts - full html in tooltips

I am trying to make Google Charts Display custom tooltips with full HTML in them. I know how to enable tooltips and pass appropriate data - the problem is - even when allowHTML option is enabled, ...

Show Detail

Tooltips in Google Charts: Timeline API

I am trying to customize the content of tooltips displayed in Timeline charts upon hover, it seems like google doesn't support customizing tooltips apart from a few charts Is there a workaround to

Show Detail

Best way to format number in SQl for display through Google Charts tooltips bar?

I have a SQL query that outputs data into an array, and I'm using it in google charts. When the number field is formatted as a raw number (e.g. 374000000) the chart and the formatting in my code wo...

Show Detail

Google Charts tooltips

Is there any way to make tooltips in Google Charts always visible? As I could find in API, I can only disable them at all.

Show Detail

Show multiple tooltips in Google Charts

I'm using the combo chart from Google Charts (https://google-developers.appspot.com/chart/interactive/docs/gallery/combochart) in my web application. I have set the tooltips to show on select by

Show Detail

Google Charts: multiple lines with custom tooltips

I have a Google LineChart with multiple lines. These points do not share the same X value's so i have to format my data in a certain way to make it work: var data = google.visualization.arrayToDat...

Show Detail

Google charts with tooltips and colors

I have seen one post which shows how to make color but it uses a method which is i didnt understand and its little dificult for me. im using this method in fiddle which is easy But it didnt work HTML

Show Detail

Google Materials Charts (Scatter) not showing trendlines or tooltips

I'm using Google charts, Materials Charts running in IE v11, and when I do things like trendlines and tooltips no longer work. The same happens if I add a column {type: 'string', role: 'tooltip'},

Show Detail

Google charts tooltips not working on mobile

I'm using google charts for various charts. I have one, a bar chart that I'm struggling with right now. The chart itself is working great and I have no issues with it really, especially on desktop.

Show Detail