This repository has been archived by the owner on Jul 19, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 299
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This changeset exposes the `createClass` method in `lib/core`, and adds a third argument to it so that you can pass the `dataKey` value that was previously fixed in the `dataKeys` variable. E. g. if you want to use https://github.com/Regaddi/Chart.StackedBar.js, you would do something like `var StackedBarChart = require('react-chartjs').createClass('StackedBar', ['getBarsAtEvent'], 'bars');` (provided you previously registered `StackedBar` with Chart.js, of course).
- Loading branch information
Showing
2 changed files
with
6 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
eb2c1f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do you register StackedBar with Chart.js? @tcard
eb2c1f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
classData.initializeChart
requires Chart.js, as far as I can see you can't register anything.eb2c1f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ryansmith94 Sorry for the late response, I wasn't around a keyboard.
tl;dr: Just by including it.
I can see that now StackedBar registers itself as soon as you
require
or<script>
it.This didn't work like this when I wrote this commit. Back then, it required a
Chart
in the global scope. In fact, I had to manually edit the code forChart.StackedBar.js
to be able to use this with CommonJS modules (for Node.js and Browserify), something like this:And then do this:
And that's what I meant by "registering", I guess.
(I may have gotten something wrong in this history. I've pretty much forgot everything about this project in those months.)
eb2c1f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @tcard. No worries. Ok thanks, I'll give that a try when I get a spare minute. Thanks for the history too 👍
eb2c1f0
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@andrewhickey @daniel-abbey might be useful for you to know this if I don't get time to try this.