Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to format the X axis while using datetime_sacale? #10

Open
somoza opened this issue Oct 16, 2024 · 0 comments
Open

Any way to format the X axis while using datetime_sacale? #10

somoza opened this issue Oct 16, 2024 · 0 comments

Comments

@somoza
Copy link

somoza commented Oct 16, 2024

%{datetime: first_record} = List.first(data)
    %{datetime: last_record} = List.last(data)
    max = Enum.max_by(data, & &1.count).count

    datetime_scale = datetime_scale(first_record, last_record)
    number_scale = number_scale(0, max)

    dataset =
      dataset(data,
        x: {datetime_scale, & &1.datetime},
        y: {number_scale, & &1.count}
      )

    to_graph(
      scales: [datetime_scale: datetime_scale, number_scale: number_scale],
      datasets: [dataset: dataset]
    )

Results in:

image

Is there some way to show minutes, 10 by 10? For example, 16:10, 16:20 and so on?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant