-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bde3996
Showing
16 changed files
with
2,394 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": ["es2015"] | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
.DS_Store | ||
node_modules/* |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
Contributing to Chart.js | ||
======================== | ||
|
||
Contributions to Chart.js are welcome and encouraged, but please have a look through the guidelines in this document before raising an issue, or writing code for the project. | ||
|
||
|
||
Using issues | ||
------------ | ||
|
||
The [issue tracker](https://github.com/chartjs/Chart.js/issues) is the preferred channel for reporting bugs, requesting new features and submitting pull requests. | ||
|
||
If you're suggesting a new chart type, please take a look at [writing new chart types](https://github.com/chartjs/Chart.js/blob/master/docs/07-Advanced.md#writing-new-chart-types) in the documentation or consider [creating a plugin](https://github.com/chartjs/Chart.js/blob/master/docs/07-Advanced.md#creating-plugins). | ||
|
||
To keep the library lightweight for everyone, it's unlikely we'll add many more chart types to the core of Chart.js, but issues are a good medium to design and spec out how new chart types could work and look. | ||
|
||
Please do not use issues for support requests. For help using Chart.js, please take a look at the [`chartjs`](http://stackoverflow.com/questions/tagged/chartjs) tag on Stack Overflow. | ||
|
||
|
||
Reporting bugs | ||
-------------- | ||
|
||
Well structured, detailed bug reports are hugely valuable for the project. | ||
|
||
Guidlines for reporting bugs: | ||
|
||
- Check the issue search to see if it has already been reported | ||
- Isolate the problem to a simple test case | ||
- Provide a demonstration of the problem on [JS Bin](http://jsbin.com) or similar | ||
|
||
Please provide any additional details associated with the bug, if it's browser or screen density specific, or only happens with a certain configuration or data. | ||
|
||
|
||
Local development | ||
----------------- | ||
|
||
Run `npm install` to install all the libraries, then run `gulp dev --test` to build and run tests as you make changes. | ||
|
||
|
||
Pull requests | ||
------------- | ||
|
||
Clear, concise pull requests are excellent at continuing the project's community driven growth. But please review [these guidelines](https://github.com/blog/1943-how-to-write-the-perfect-pull-request) and the guidelines below before starting work on the project. | ||
|
||
Be advised that **Chart.js 1.0.2 is in feature-complete status**. Pull requests adding new features to the 1.x branch will be disregarded. | ||
|
||
Guidelines: | ||
|
||
- Please create an issue first: | ||
- For bugs, we can discuss the fixing approach | ||
- For enhancements, we can discuss if it is within the project scope and avoid duplicate effort | ||
- Please make changes to the files in [`/src`](https://github.com/chartjs/Chart.js/tree/master/src), not `Chart.js` or `Chart.min.js` in the repo root directory, this avoids merge conflicts | ||
- Tabs for indentation, not spaces please | ||
- If adding new functionality, please also update the relevant `.md` file in [`/docs`](https://github.com/chartjs/Chart.js/tree/master/docs) | ||
- Please make your commits in logical sections with clear commit messages | ||
|
||
Joining the project | ||
------------- | ||
- Active committers and contributors are invited to introduce yourself and request commit access to this project. Please send an email to [email protected] or file an issue. | ||
- We have a very active Slack community that you can join at https://chartjs-slack-automation.herokuapp.com. If you think you can help, we'd love to have you! | ||
|
||
License | ||
------- | ||
|
||
By contributing your code, you agree to license your contribution under the [MIT license](https://github.com/chartjs/Chart.js/blob/master/LICENSE.md). |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
The MIT License (MIT) | ||
Copyright (c) 2016 Jonathon Hill | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
# chartjs-plugin-draggable.js | ||
|
||
A plugin for Chart.js >= 2.4.0 | ||
|
||
Makes elements such as annotations movable via drag and drop. | ||
|
||
## Configuration | ||
|
||
To make an element draggable, simply add the following options to the element's config section. | ||
|
||
```javascript | ||
{ | ||
... | ||
draggable: true, | ||
onDragStart: function(event) { | ||
|
||
}, | ||
onDrag: function(event) { | ||
|
||
}, | ||
onDragEnd: function(event) { | ||
|
||
} | ||
} | ||
``` | ||
|
||
## Supported Elements | ||
|
||
### Annotations | ||
|
||
Requires chartjs-plugin-annotation.js >= 0.3.0. | ||
|
||
Line annotations are supported: | ||
|
||
```javascript | ||
var options = { | ||
... | ||
annotation: { | ||
annotations: [ | ||
{ | ||
type: 'line', | ||
mode: 'horizontal', | ||
scaleID: 'y-axis-0', | ||
value: 25, | ||
draggable: true, | ||
onDrag: function(event) { | ||
console.log(event.subject.config.value); | ||
} | ||
} | ||
] | ||
} | ||
}; | ||
``` | ||
|
||
## To-do Items | ||
|
||
The following features still need to be done: | ||
|
||
* Box annotation support | ||
* Skewed line annotation support | ||
|
||
## Installation | ||
|
||
To install via npm: | ||
|
||
``` | ||
npm install chartjs-plugin-annotation --save | ||
``` | ||
|
||
Or, download a release archive file from the releases page. | ||
|
||
## Contributing | ||
|
||
Before submitting an issue or a pull request to the project, please take a moment to look over the [contributing guidelines](https://github.com/chartjs/chartjs-plugin-annotation.js/blob/master/CONTRIBUTING.md) first. | ||
|
||
## License | ||
|
||
chartjs-plugin-draggable.js is available under the [MIT license](http://opensource.org/licenses/MIT). |
Oops, something went wrong.