Git Product home page Git Product logo

Comments (12)

leeoniya avatar leeoniya commented on June 3, 2024

I want to achieve custom time segmentation points

are you asking to place the same x ticks on a grouped bar chart as on another time series line chart?

can you attach your data and draw an example of what you are trying to get?

from uplot.

dingjunweibjkanyun avatar dingjunweibjkanyun commented on June 3, 2024

I want to achieve custom time segmentation points

are you asking to place the same x ticks on a grouped bar chart as on another time series line chart?

can you attach your data and draw an example of what you are trying to get?

yes

from uplot.

leeoniya avatar leeoniya commented on June 3, 2024

this is tricky. a grouped bar chart can only have x labels at the exact data points, but a time series chart can have x labels in any place. you will have to provide specific example data and what you expect. i cannot give you a generic answer.

from uplot.

dingjunweibjkanyun avatar dingjunweibjkanyun commented on June 3, 2024

this is tricky. a grouped bar chart can only have x labels at the exact data points, but a time series chart can have x labels in any place. you will have to provide specific example data and what you expect. i cannot give you a generic answer.

ok

from uplot.

dingjunweibjkanyun avatar dingjunweibjkanyun commented on June 3, 2024

I want to achieve a grouped bar chart that can freely segment the x-axis like a time series chart. The purpose is to ensure that the x-axis of both the time series chart and the grouped bar chart appears neat and consistent.
I tried to segment it in the same way, but a grouped bar chart will introduce some new issues.
issues list:

  1. Hooks.setCursor returned incorrect index.
  2. The drawn area is always the entire canvas, rather than just the location covered by the data, as in a time series chart.

Is there any way to meet my needs?

this is demo.
https://jsfiddle.net/ofdq1cm8/13/
image

from uplot.

dingjunweibjkanyun avatar dingjunweibjkanyun commented on June 3, 2024

Can you give me some help?

from uplot.

leeoniya avatar leeoniya commented on June 3, 2024

i have good news and bad news for you.

the bad news is that i cannot help you with synchronizing grouped bar x axis with a linear time axis. it is not something that can be done easily, or even makes sense. if you know of another chart library that is able to do this, please use it instead of uPlot.

the good news is that for the example you are showing with only two bars per point, you can use a real time axis for both plots. you may actually even use a single plot for all your data. to do this you simply create two bar series: one with align: -1 and another with align: 1. after you do this you will have to expand your x time range slightly so that the bar at the left edge and the bar at the right edge do not get cut off.

const _bars100Left = bars({size: [1], align: 1});
const _bars100Right = bars({size: [1], align: -1});

from uplot.

dingjunweibjkanyun avatar dingjunweibjkanyun commented on June 3, 2024

Thank you very much

from uplot.

dingjunweibjkanyun avatar dingjunweibjkanyun commented on June 3, 2024

Can you give me some suggestions and directions regarding automated testing of charts?

from uplot.

dingjunweibjkanyun avatar dingjunweibjkanyun commented on June 3, 2024

When I am using uPlot to render multiple lines on a chart, such as when the number of lines exceeds 100, there is a performance pressure when the mouse moves on the chart.
My solution is to take a leaf out of DataDog's book. Disable the built-in highlight function of uplot. The rendering of the highlight layer will be done on another layer so that it's not necessary to frequently update the main layer, but just update the highlighted layer.
Is this a good idea?
image

from uplot.

leeoniya avatar leeoniya commented on June 3, 2024

The rendering of the highlight layer will be done on another layer so that it's not necessary to frequently update the main layer, but just update the highlighted layer.

related: #922

Can you give me some suggestions and directions regarding automated testing of charts?

https://playwright.dev/docs/test-snapshots

from uplot.

dingjunweibjkanyun avatar dingjunweibjkanyun commented on June 3, 2024

Thank you very much

from uplot.

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.