question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Question] How Can i make my custom tooltip template in bar chart ?

See original GitHub issue

♻️ env

  • React (latest)
  • TypeScript (latest)
  • Chrome (latest)
  • OS : Mojave 10.14.5

Description

I want to make my custom tooltip in bar-chart. With reference to options.d.ts and documentation, I wrote the following:

// in bb.generate({}), in useEffect(React Hooks) 
      data: {
        columns: [['data3', 130, -150, 200, 300, -200, 100]],
        type: 'bar',
        colors: {
          data3: '#E1E1E1',
        },
      },
      tooltip: {
        grouped: false,

        contents(
          data: any,
          defaultTitleFormat: string,
          defaultValueFormat: string,
          color: any
        ) {
          return {
            bindto: '#tooltip',
            template:
              '<ul><li>Index<br>{=TITLE}</li>{{<li class={=CLASS_TOOLTIP_NAME}><span>{=VALUE}:{=VAR}</span><br><span style=color:{=COLOR}>{=NAME}</span></li>}}</ul>',
          };
        },
      },
<>
      <div id="bar-chart"></div>
      <div id="tooltip"></div>
</>

I expect sample Result. But My Result… is…

image

How Can I solve It?

Steps to check or reproduce

Generate billboard chart in useEffect.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
netilcommented, Jul 17, 2019

@SoYoung210, this was caused by the incorrect definition. I’ll fix that and thanks for noticing me that. 😃 Sometimes definition can be erroneous(like this time), so always try consulting from API docs.

0reactions
netilcommented, Aug 7, 2019

🎉 This issue has been resolved in version 1.10.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

Customize different tooltips of bar chart
I know it can use tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %> Files" to custmize the tooltips. But is it possible to show ...
Read more >
How to Display Different Text For Each Bar in the Tooltip in ...
How to Make Gantt Timeline Chart in Chart JS · How to create a custom HTML tooltip from scratch in Chart JS ·...
Read more >
How to Create Custom Shape Tooltip in Chart JS - YouTube
How to Create Custom Shape Tooltip in Chart JSIn this video we will explore how to create custom shape tooltip in chart js....
Read more >
How to Add More Information in the Tooltips in Chart JS
How to Add More Information in the Tooltips in Chart JSIn this video we will explore how to add more information in the...
Read more >
Customizable Tooltips on Excel Charts
How to create customizable, meaningful tooltips on XY Scatter Charts in Microsoft Excel.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found