In Google Charts, is there a way to change the date formatting of the tooltip value, without making it an HTML tooltip. For example, by default I get this:
But what I really want is this:
The chart code is as following:
data_table = google.visualization.arrayToDataTable(graph_data_raw);
chart = new google.visualization.LineChart(document.getElementById('DivGraph'));
chart.draw(data_table, {
hAxis: {
ticks: x_ticks,
format: 'MMM d, y',
},
});
While the dynamic and interactive Google Charts are actively maintained, we officially deprecated the static Google Image Charts way back in 2012. This gives us the right to turn it off without notice, which may happen soon.
Tooltips are a user interface element that pops up when you hover over a component on the screen. They display additional information for the component, and they're a great way to create meaningful yet decluttered data visualizations.
Found the solution, using DateFormat
:
var date_formatter = new google.visualization.DateFormat({
pattern: "MMM dd, yyyy"
});
date_formatter.format(data_table, 0); // Where 0 is the index of the column
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With