Coder Social home page Coder Social logo

scottfwalter / angular-highcharts-tooltip Goto Github PK

View Code? Open in Web Editor NEW

This project forked from areknow/angular-highcharts-tooltip

0.0 1.0 0.0 242 KB

Dynamic Angular tooltip component in Highcharts.

Home Page: https://angular-highcharts-tooltip.netlify.app/

TypeScript 89.00% HTML 5.94% SCSS 5.06%

angular-highcharts-tooltip's Introduction

Angular Highcharts Tooltip

Problem with Highcharts tooltips in Angular

Original motivation for this project here and here.

Using Highcharts with Angular comes with a few tradeoffs. The most difficult one that I have come across has been the lack of dynamic component support in the highcharts tooltip formatter. This repository shows you how to easily create a dynamic tooltip component with real chart data and inject it into the Highcharts view. Live example.

dynamic chart tooltip example

Setting up a dynamic tooltip

After creating your custom tooltip component, you can use the ComponentFactory class example to return a dynamically injected component. This symbol can then be passed through to the Highcharts formatter callback by using your new components nativeElement.outerHTML property. This allows you to fully control the template and styling of your tooltip instead of defining it using the Highcharts tooltip formatter API and string interpolation. You can also bind the point data that is currently hovered over, and pass that to a data attribute on your custom tooltip component.

Implementation example.

Custom tooltip example.

Starting the demo

Run the following commands after cloning this repository to demo this on your local machine

$ npm install
$ ng serve

Small Update

angular-highcharts-tooltip's People

Contributors

scottwalter-nice avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.