Skip to content

Time cartesian with grouped data #5139

Description

@reflectionhu

Hello all. First thanks for this fantastic plugin, but I have a (hopefully small) problem.

I'm using time cartesian chart with grouped dataset (please see included codepen) to display engine temperatures (start @ datetime, max @ datetime, stop @ datetime) . Time axis works well if only one dataset array is provided.

To understand my logic, please have a look at the following description. Currently I am working with 6 start-run-stop cycles for testing purposes.

Entry logic:
entry = {x: event datetime (moment), y: temperature (int)};

Dataset logic:
Engine start temp = [entry1start, entry2start, entry3start];
Engine max temp = [entry1max, entry2max, entry3max];
Engine stop temp = [entry1stop, entry2stop, entry3stop];

Expected Behavior

Please have a look at the attached drawing.

Current Behavior

Time scale should be distributed by assigned datetime. Eg. first cycle:
start @ 2017-11-02T20:30:00.000Z,
max reached @ 2017-11-03T13:07:00.000Z
stopped @ 2017-11-03T16:30:00.000Z

Now have a look @ codepen.
start is ok
max reached at 13:07, seems to be ok
stopped at 16:30, but bar is at the end of day

Second cycle is started at 20:53 but bar is placed before previous cycle's end
2nd cycle's max is reached at 11-04 04:50 but placed in center of day
2nd cycle's end is at 11-04 11:50 but placed to beginning at 11-05

...and so on

Possible Solution

Steps to Reproduce (for bugs)

I created a Codepen to reproduce my problem.
https://codepen.io/anon/pen/WdJrJY

Context

Environment

  • Chart.js version: 2.7.1
  • Browser name and version: Chrome 63.0.3239.132 64bit
  • Link to your project:
    untitled-1

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions