Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Real time data and navi scripts #120

Open
4 tasks done
KatarinaSmirnova opened this issue May 5, 2024 · 1 comment
Open
4 tasks done

Real time data and navi scripts #120

KatarinaSmirnova opened this issue May 5, 2024 · 1 comment

Comments

@KatarinaSmirnova
Copy link

Describe the bug

Hi, I've been working with the library and it looks great. I have a problem adding a script with ‘navi’ when using real time data.

`
// Navy ~ 0.1-lite

// Meta tag
[OVERLAY name=Custom, ctx=Canvas, author=ChartMaster, version=1.0.0]
console.log("Draw function called");
draw(ctx) {
console.log("Draw function called");
}

`

`
let chart = new NightVision("chart-container", {
autoResize: true,
colors: {
back: "#111113",
grid: "#2e2f3055",
},
scripts: [Custom]
});

`

I just want to be able to log a message at that time and it never arrives. Previously adding data to a test JSON file bugged the whole graph, any solutions, thanks!
I make a clarification, in sandbox I seem to have some problems updating the ws, the client blocks it.

Reproduction

https://codesandbox.io/p/sandbox/playing-around-10-forked-problem-kg6gtq?file=%2Fmain.js

Steps to reproduce

No response

Javascript Framework

no-framework (vanilla-js)

Logs

No response

Validations

  • Read the docs.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Make sure this is a NightVision issue and not a framework-specific issue.
  • The provided reproduction is a minimal reproducible example of the bug.
@vattevaii
Copy link

I think you need to add this. I'm not totally sure if type and name are correct tho.. Since you have added in the script, you have to attach a overlay for that script.

chart.data.panes[0].overlays.push({
    type: "Custom",
    name: "Custom",
    data: [],
    props: {},
    settings: {
      zIndex: 1
    }
  })

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants