0

Help with Zkoss Charts Tooltip

asked 2021-06-10 12:54:14 +0800

bztom35 gravatar image bztom35
103 4

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

delete flag offensive retag edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-06-17 15:43:00 +0800

cor3000 gravatar image cor3000
6032 2 7
ZK Team

updated 2021-06-17 15:47:39 +0800

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>");
link publish delete flag offensive edit

Comments

Thank you for your prompt response. This works as expected!

bztom35 ( 2021-06-17 23:39:25 +0800 )edit
Your answer
Please start posting your answer anonymously - your answer will be saved within the current session and published after you log in or create a new account. Please try to give a substantial answer, for discussions, please use comments and please do remember to vote (after you log in)!

[hide preview]

Question tools

Follow
1 follower

RSS

Stats

Asked: 2021-06-10 12:54:14 +0800

Seen: 9 times

Last updated: Jun 17

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More