Last active
August 19, 2016 03:06
-
-
Save andredumas/b97cfb46160ff5299a8d to your computer and use it in GitHub Desktop.
TechanJS Accessors Example
This file contains hidden or 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
/** | |
* Demonstrating configuring a techanjs plot to accept and plot custom data types. | |
*/ | |
// Either, update the default plot accessor | |
// All plots have default accessors. Here we are updating the default and redefining how | |
// to get close from the data | |
candlestick.accessor().close(function(d) { | |
return d.currentBid; // Where d is an item in your supplied array | |
}); | |
// or | |
// Construct a new accessor and update it | |
var accessor = techan.accessor.ohlc() | |
.close(function(d) { | |
return d.currentBid; // Where d is an item in your supplied array | |
}); | |
// Overwrite the plots default with the newly constructed | |
candlestick.accessor(accessor); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment