当前位置:网站首页>Chart. JS multitooltip tag - chart js multiTooltip labels
Chart. JS multitooltip tag - chart js multiTooltip labels
2022-07-03 02:50:00 【Bustling city 】
problem :
I'm trying to get charts.js to display the label name from each dataset in the tooltip. I'm trying to use charts.js To display the label name of each dataset in the tooltip .
My code: My code :
var barChartData = { labels : ["January","February","March","April","May","June","July"], datasets : [ { label: "Bob", fillColor : "rgba(88,196,246,0.5)", strokeColor : "rgba(88,196,246,0.8)", highlightFill: "rgba(88,196,246,0.75)", highlightStroke: "rgba(88,196,246,1)", data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] }, { label: "Tina", fillColor : "rgba(74,211,97,0.5)", strokeColor : "rgba(74,211,97,0.8)", highlightFill : "rgba(74,211,97,0.75)", highlightStroke : "rgba(74,211,97,1)", data : [randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor(),randomScalingFactor()] } ]}var ctx = document.getElementById("canvas").getContext("2d");window.myBar = new Chart(ctx).Line(barChartData, { responsive : true, animation: true, barValueSpacing : 5, barDatasetSpacing : 1, tooltipFillColor: "rgba(0,0,0,0.8)", multiTooltipTemplate: "<%= label %> - <%= value %>"});With my above code the tooltip when hovering above "January" displays: Use the code above , When hovering over “1 month ” Above , The tooltip displays :
JanuaryJanuary - xxJanuary - xxAny ideas how I can get it to display the following? Any idea how can I make it show the following ?
JanuaryBob - xxTina - xxSolution :
Reference resources : https://stackoom.com/en/question/1eqF4边栏推荐
- [hcia]no.15 communication between VLANs
- Gbase 8C trigger (I)
- Gbase 8C create user / role example 2
- Source code analysis | layout file loading process
- Getting started | jetpack hilt dependency injection framework
- Gbase 8C system table PG_ auth_ members
- Privatization lightweight continuous integration deployment scheme -- 01 environment configuration (Part 2)
- Use cve-2021-43893 to delete files on the domain controller
- [fluent] listview list (map method description of list set | vertical list | horizontal list | code example)
- Gbase 8C system table PG_ cast
猜你喜欢

random shuffle注意

【翻译】后台项目加入了CNCF孵化器

Deep reinforcement learning for intelligent transportation systems: a survey paper reading notes

Kubernetes cluster log and efk architecture log scheme

Three. JS local environment setup

用docker 连接mysql的过程

Error invalid bound statement (not found): com ruoyi. stock. mapper. StockDetailMapper. XXXX solution

Check log4j problems using stain analysis

Classes and objects - initialization and cleanup of objects - constructor call rules

I2C 子系统(一):I2C spec
随机推荐
[fluent] future asynchronous programming (introduction | then method | exception capture | async, await keywords | whencomplete method | timeout method)
Getting started | jetpack hilt dependency injection framework
Cancer biopsy instruments and kits - market status and future development trends
Source code analysis | layout file loading process
[shutter] setup of shutter development environment (supplement the latest information | the latest installation tutorial on August 25, 2021)
tensor中的append应该如何实现
Gbase 8C system table PG_ aggregate
Joking about Domain Driven Design (III) -- Dilemma
用docker 連接mysql的過程
Interview stereotyped version
C语言中左值和右值的区别
Gbase 8C system table PG_ amproc
Gbase 8C system table PG_ auth_ members
当lambda没有输入时,是何含义?
Your family must be very poor if you fight like this!
I2C 子系统(一):I2C spec
How to return ordered keys after counter counts the quantity
Check log4j problems using stain analysis
Can netstat still play like this?
Practice of traffic recording and playback in vivo