Git Product home page Git Product logo

Comments (5)

zigomir avatar zigomir commented on June 19, 2024

@Axword

To fix it I had to register ChartTrendline before the Tooltip plugin, ie

Chart.register(
  // ...otherPlugins
  ChartTrendline,
  Tooltip,
  // ...otherPlugins
)

order matters here.

caveat: we're using Chartjs v3 & forked chartjs-plugin-trendline to make it work with Chartjs v3

from chartjs-plugin-trendline.

Hibrix-net avatar Hibrix-net commented on June 19, 2024

@Axword

To fix it I had to register ChartTrendline before the Tooltip plugin, ie

Chart.register(
  // ...otherPlugins
  ChartTrendline,
  Tooltip,
  // ...otherPlugins
)

order matters here.

caveat: we're using Chartjs v3 & forked chartjs-plugin-trendline to make it work with Chartjs v3

Hello,

Could you elaborate a little more the answer please? Do we first have to de-register the integrated ChartJS tooltip plugin and then re-register it after the ChartTrendline?

Thanks,

from chartjs-plugin-trendline.

zigomir avatar zigomir commented on June 19, 2024

I know nothing about your codebase, but in ours, changing this order helped, i.e. moving ChartTrendline before Tooltip.

Chart.register(
  // ...otherPlugins
- Tooltip,
- ChartTrendline,
+ ChartTrendline,
+ Tooltip,
  // ...otherPlugins
)

Maybe it doesn't work like this in Chartjs v2, I've never used it 🤷‍♂️

from chartjs-plugin-trendline.

Hibrix-net avatar Hibrix-net commented on June 19, 2024

Hi,

Thanks for your answer. So I understand you are using a custom tooltip plugin, because as far as I know there's an embedded tooltip plugin within the ChartJS core that can only be enabled/disbled but not registered/unregistered.

Am I missing something here?

I am using the VueJS ChartJS wrapper from here (that btw is using ChartJS version 2.8): https://github.com/apertureless/vue-chartjs

Not sure how to proceed, I already tried some hacks with no luck at all. Any advice will be very welcome.

Best,

from chartjs-plugin-trendline.

its0xFUL avatar its0xFUL commented on June 19, 2024

On the topic of z-index, would it be possible to add an option to draw trend line with a lower z index than the graph itself (ie. visually behind)? Can provide a PR if anyone else needs this.

Great plugin btw!

from chartjs-plugin-trendline.

Related Issues (20)

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.