vasturiano / timelines-chart

Timelines Chart
http://vasturiano.github.io/timelines-chart/example/categorical/
MIT License
556 stars 121 forks source link

Using geologic time ranges #51

Closed mickdee closed 4 years ago

mickdee commented 5 years ago

I'm having some difficulty using time ranges not formatted as dates. For example, dates in this case are formatted as integers that refer to millions of years ago. The x-axis would be optimal fixed for a specific duration (4600 to 0, for example) with 'date' range bars that are simple integers.

It looks to me like even the custom time format chart still requires data to be formatted as date/time, but is there a workaround for this use case? Cheers!

vasturiano commented 5 years ago

@mickdee thanks for reaching out. You can look into this example, for custom time formats: http://vasturiano.github.io/timelines-chart/example/custom-time-format/ source

Basically you can set the numbers in your dates to represent conceptually anything numeric, like millions of years for example. Then use timeFormat to display them as numbers (%Q), or any other format that you wish.