Giter Site home page Giter Site logo

chart in loop ? about data2viz HOT 2 CLOSED

Reqeique avatar Reqeique commented on June 11, 2024
chart in loop ?

from data2viz.

Comments (2)

Reqeique avatar Reqeique commented on June 11, 2024 1

Thanks for the response @pmariac ,
was able to resolve the issue by executing it asynchronously to be more specific using coroutines, also in the case of mine it was simple chart which represent 1 dimensional data with single line graph additional as was mentioned by you redrawing in the canvas seems to be super smooth in both higher and lower stream rate with reasonably lower resources usage(mem)
would also like to give a try to the ChartModel in the near future
here's the code in case

val p = Pane()
var x = 1.0
val viz = p.newVizContainer().apply {
         size = Size(width, height)
 }
scope { this: CoroutineScope

          while(true) {
                x++
                values[1] = x
                viz.chart(values) {
                val values = quantitative({ domain })
                line(values, values)
         }
}
val scene = Scene(p, width, height)
jfxpanel.scene = scene

from data2viz.

pmariac avatar pmariac commented on June 11, 2024

It is actually impossible to update data in the current version of charts.
It will be available in a near future with the introduction of the ChartModel.

What you can do right now, if your chart is very light and draw fast, is to completely clean and redraw everything.

By the way, it is easier for us to track issues on the data2viz forum when it concerns the Charts-kt project: https://forum.data2viz.io/ just create a thread in the charts-kt section.

from data2viz.

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.