n3-charts / line-chart

Awesome charts for AngularJS.
http://n3-charts.github.io/line-chart/
MIT License
1.2k stars 179 forks source link

Added zoom trigger key and access to raw value for tooltip hook #533

Closed chaosmail closed 7 years ago

chaosmail commented 7 years ago

Hi Sebastien,

I made a few changes that I needed for my last project, mainly better customization for zoom and tooltips. Zoom option now supports a key property to define the trigger key for the zoom. (On Chrome on Linux, the altKey always triggered the Chrome Menu and hence I had to use shiftKey instead.)

In the tooltipHook, one can now access the raw values of the dataset (and not only the parsed x, y0 and y1 values), which makes it much easier to customize it.

The series id option is not mandatory, however changing visibility fails when the property is missing. I fixed this problem as well.

I also added some documentation.

This is only a draft, and I would love to get your feedback on these options.

Best, Christoph

PS: I made a couple of more changes for better rendering on hidden elements. I will push these changes soon as well, I just need to write some tests.

chaosmail commented 7 years ago

Oh my dear travis, I get the same typescript lint errors on my local machine, however I have no idea whats going on with e2e:test:angularjs.

lorem--ipsum commented 7 years ago

I think those changes are okay, however please be aware that you'll need to port them in the new version as well. Feel free to merge and release when Travis passes :-)

chaosmail commented 7 years ago

Alright tests are passing, however I bumped node version to 4.0.0 in travis.

chaosmail commented 7 years ago

The series id option is not mandatory, however changing visibility fails when the property is missing. I fixed this problem as well. I also updated the tests for missing series id.

chaosmail commented 7 years ago

Alright @lorem--ipsum, I think now I am good with this one. Will merge soon.