Skip to content

Time charts #69

@ProsWeb

Description

@ProsWeb

Checklist

  • I made sure that there are no existing issues - open or closed - which I could contribute my information to.
  • I have taken the time to fill in all the required details. I understand that the question will be dismissed otherwise.

What is/are your question(s)?

Hi!
Does this add-on implement time charts?
How can I rewrite my code from https://vaadin.com/directory/component/chartjs-add-on-for-vaadin-14 to this one?
My code:

.addDataset(new TimeLineDataset()
...
.add(Axis.X, new TimeScale()
                    .time()
                      .isoWeekday(true)
                      .unit("day")
                      .displayFormats()
                        .hour("HH")
                        .minute("HH:mm")
                        .and()
                      .stepSize(1)
                      .and())
              .add(Axis.Y, new LinearScale()
...

But this add-on doesn't have TimeLineDatasets, only LineDataset. So I tried to achieve my goal like this:

LineData lineData = new LineData();
        lineData
                .addDataset(new LineDataset().setLabel("label1"))
                .addDataset(new LineDataset().setLabel("label2"));
        LineOptions lineOptions = new LineOptions();
        lineOptions
                .setResponsive(true)
                .setHover(new CoreInteractionOptions()
                        .setIntersect(true))
                .setScales(new Scales()
                        .addScale(Scales.ScaleAxis.X, new TimeScaleOptions()
                                .setAdapters(new TimeScaleOptions.Adapters().setDate("yyyy-MM-dd HH:mm:ss"))
                                .setTime(new TimeScaleOptions
                                        .TimeOptions()
                                            .setIsoWeekday(true)
                                            .setUnit("day"))
                                            .setDisplayFormats(new TimeScaleOptions.DisplayFormats()
                                                    .setHour("HH")
                                                    .setMinute("HH:mm")))
                       .addScale(Scales.ScaleAxis.Y, new LinearScaleOptions()

But that doesn't work. I got error in my browser:
Uncaught Error: This method is not implemented: Check that a complete date adapter is provided.

Related to this question: https://vaadin.com/forum/t/discussion-and-feedback-for-chart-js-wrapper-for-vaadin/178146/4

Additional information

No response

Metadata

Metadata

Assignees

Labels

questionFurther information is requested

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions