Skip to content

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

@somoza

Description

@somoza
%{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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions