Giter Club home page Giter Club logo

Comments (3)

camheras avatar camheras commented on June 12, 2024

Yeah I don't understand either why the exemple is bugged, it maybe needs an update 🤷‍♂️

from chartjs-chart-financial.

Grafnus avatar Grafnus commented on June 12, 2024

I haven't implemented the plugin into our page yet. Is the bug already fixed?

from chartjs-chart-financial.

abhinavsood avatar abhinavsood commented on June 12, 2024

@Grafnus I figured out why the behavior happens (wicks of the candles disappear when showing the candle after hiding them once) and what you can do to resolve it:

Why:

In this code: https://github.com/chartjs/chartjs-chart-financial/blob/master/src/element.candlestick.js#L15-L22
When you hide the dataset borderColors takes the value transparent and thus changes up, down and unchanged to transparent as well. It retains that value when you show the dataset again.

Resolution:

Explicitly set borderColor as a dataset property in your Chart, something like:

const chart = new Chart(chartContext, {
    type: chartType,
    data: {
      datasets: [{
          label: candlestickTitle,
          data: candlestickData,
          borderColor: {
            up: 'rgba(100, 150, 100, 1)',
            down: 'rgba(150, 100, 100, 1)',
            unchanged: 'rgba(100, 100, 100, 1)',
          },
          borderWidth: 1,
        },
...

This ensures that borders always have a color to display when showing the dataset again

from chartjs-chart-financial.

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.