mode / alamode

A community-maintained library of visualizations for Mode reports
MIT License
70 stars 67 forks source link

Render chart annotations correctly when data is grouped #3

Closed aalpern closed 7 years ago

aalpern commented 7 years ago

Chart annotations only worked when the chart plots a single data series. If the chart used the “Group By” option, the calculation of which point on the X-axis to render the annotation at was incorrect, causing the selector for the chart element to return undefined.

There doesn’t seem to be away to access the chart options, so I had to add a group_by option to the chartAnnotations() function, which should mirror the Group By setting of the chart. If there is a way to access the chart options, I'd be more than happy to use that instead, but I can't find any API documentation.

This fixes #2 .

aalpern commented 7 years ago

@bstancil Any chance you could take a look at this?

bstancil commented 7 years ago

@aalpern merged and pushed!

bstancil commented 7 years ago

(small update here: https://community.modeanalytics.com/gallery/chart-annotations/)

aalpern commented 7 years ago

Thanks!