简体   繁体   中英

Apex Charts custom XAxis tooltip label on mouseover

在此处输入图像描述

I have this Apex chart's heatmap ( https://apexcharts.com/ ) with days on x axis (01-31).

When the user mouseover i would like to add the shortened day of the week on tooltip, something like this:

在此处输入图像描述

How can i achieve this?

In xaxis change tooltip formatter to semething like this

xaxis: {
  tooltip: {
    formatter: (val, opts) => {
      let day = "FRI"; // your logic for getting day name
      return `${val}<br>${day}`;
    }
  }
},

https://apexcharts.com/docs/options/xaxis/#tooltipFormatter

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM