Git Product home page Git Product logo

Comments (7)

vasturiano avatar vasturiano commented on May 11, 2024

Hi @dcmohann thanks for reaching out.

The timeformat you highlighted is actually intentional, to provide a more contextual overview of the time range. Ticks on the first of the month will be labeled with only the month. At the start of each week (Sunday tick) you'll get the month-date format. Other days will be displayed as weekday-date. Beyond that you will get actual times. This is inspired by https://bl.ocks.org/mbostock/4149176.

If you prefer a different time formatting, you can provide your own using the .xTickFormat() method. F.e. to display in plain unix timestamps:

myChart.xTickFormat(ts => ts.getTime())

from timelines-chart.

dcmohann avatar dcmohann commented on May 11, 2024

Thanks @vasturiano for your information. Can you provide some example, if the custom option is possible.

from timelines-chart.

vasturiano avatar vasturiano commented on May 11, 2024

@dcmohann there is a custom time format example here:
http://vasturiano.github.io/timelines-chart/example/custom-time-format/
[source]

I'd recommend looking into d3-time-format if you're looking for a different time format.

from timelines-chart.

dcmohann avatar dcmohann commented on May 11, 2024

Hi @vasturiano, One more requirement for me, i am not sure whether the current release have this option to do it.

I would like to display the below "note" value on the segment. Is it possible?

data: [ { timeRange: [<date>, <date>], val: <val: number (continuous dataScale) or string (ordinal dataScale)> note: <String> }

from timelines-chart.

vasturiano avatar vasturiano commented on May 11, 2024

@dcmohann you can use the tooltip content to add annotations to your segments, using the method zDataLabel, which supports either plain text or html content. F.e:

myChart.zDataLabel('<div>Additional <b>data</b></div>')

from timelines-chart.

dcmohann avatar dcmohann commented on May 11, 2024

Hi @vasturiano, i think zDataLabel('data') shows as part of the tooltip, but i would like to display on the segment itself like
zlable

from timelines-chart.

vasturiano avatar vasturiano commented on May 11, 2024

I see. That's currently not supported in the current version. But, I think it's a useful feature, so I'll leave this issue open until I can dedicate some cycles to do it.
Or, I'd be happy to accept a PR for it if you have something working!

from timelines-chart.

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.