swimlane / ngx-charts

:bar_chart: Declarative Charting Framework for Angular
https://swimlane.github.io/ngx-charts/
MIT License
4.29k stars 1.15k forks source link

Trouble finding HeatMap Calendar data format #833

Open leemorris opened 6 years ago

leemorris commented 6 years ago

I'm submitting a ... (check one with "x")

Current behavior What is the format for CalendarData? A new user has a very difficult time finding a working example. The demo page https://swimlane.github.io/ngx-charts/#/ngx-charts/calendar shows a great chart but there is no easy way to get a working example. I searched and was finally able to locate an issue that actually had valid links to working Plunkers

https://github.com/swimlane/ngx-charts/issues/189

With the Heat Map plunker, I was able to get a chart to display. However, I am trying to get the HeatMap Calendar to work and I cannot find the format for the "calendarData" that is needed.

Expected behavior It should be much easier to get from finding NGX-CHARTS to having a chart displayed. I might not be looking in the right place for the information, but I am probably not alone.

Reproduction of the problem

What is the motivation / use case for changing the behavior? Better experience for developers.

Please tell us about your environment: Visual Studio Code, WebPack

FatManiac commented 6 years ago

Did you found anything new about the datas ?

leemorris commented 6 years ago

Check out the getCalendarData() method from here.

FatManiac commented 6 years ago

Thanks

nicholasfoden commented 6 years ago

To save anyone else who has this question. I worked it out to be:

[{
  name: startOfWeekDate,
  series: {
    date: dayDate,
    name: dayName,
    value: theValue
  }
}, 
etc etc, 

it might be worth adding a comment in the demo code as such....