Coder Social home page Coder Social logo

Comments (2)

RalphSteinhagen avatar RalphSteinhagen commented on September 15, 2024

Hi Anne (@zanzica) and welcome to GitHub!

This is by design and for performance reasons to minimise the necessity for doing (costly) interpolation between points and/or clipping at the boundaries (Canvas clipping is costly for large DataSets with JavaFX, you may check this e.g. via turning the isAssumeSortedData() off)

The ErrorDataSetRenderer always draws from the first to the last point that are within the visible axis range. The corresponding code can be found at: https://github.com/GSI-CS-CO/chart-fx/blob/22e5f2ab74b4f2f3024283bd4006e3c6edbbf047/chartfx-chart/src/main/java/de/gsi/chart/renderer/spi/ErrorDataSetRenderer.java#L691-L699

For most DataSets (ie. those derived from AbstractAxis) this is implemented via a fast binary search algorithm, see e.g.
https://github.com/GSI-CS-CO/chart-fx/blob/22e5f2ab74b4f2f3024283bd4006e3c6edbbf047/chartfx-dataset/src/main/java/de/gsi/dataset/spi/AbstractDataSet.java#L488

You have the following options: you may either
a) set the isAssumeSortedData() to 'off', or
b) override the public int getIndex(final int dimIndex, final double x) in your DataSet to include always the point before and after the view range (if they exist).

Hope this helps and Happy Coding!

from chart-fx.

zanzica avatar zanzica commented on September 15, 2024

I suspected that it might be connected to performance improvements. If including one outside point on each side of the drawing range, as implemented in your pull request #132 , does not cause any (relevant) performance degradation, I would be happy to see it merged. Otherwise I'll try to implement something similar in [DataSet]#getIndex as you suggested.

Thanks for the prompt reaction!

from chart-fx.

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.