-
FEATURED COMPONENTS
First time here? Check out the FAQ!
I am having trouble getting the right formats for date/time using Tooltip in Zkoss Charts 7.2.x
Tooltip tooltip = chart.getTooltip();
tooltip.setEnabled(true);
tooltip.setValueSuffix(" CFS");
tooltip.setShared(true);
tooltip.setCrosshairs(true);
tooltip.setHeaderFormat(Date/Time: {point.x}: {"MM/DD/YYYY HH:00"});<- *want to format date/time*
tooltip.setPointFormat("<table><tr><td style= color: {series.color}>
{series.name}: </td> <td style=text-align: right> {point.y} CFS <br></td></tr> </table>");
Thanks,
Bing
To set the date format please follow the highchart docs regarding value formatting and available format keys
chart.getTooltip().setUseHTML(true);
chart.getTooltip().setHeaderFormat("Date/Time: {point.x:%m/%d/%Y %H:00}<table>");
chart.getTooltip().setPointFormat(
"<tr><td style=\"color:{series.color}\">{series.name}: </td>" +
"<td style=\"text-align:right\">{point.y} CFS <br></td></tr>");
chart.getTooltip().setFooterFormat("</table>");
Asked: 2021-06-10 12:54:14 +0800
Seen: 13 times
Last updated: Jun 17 '21