@version 1.00
@since 2016/2/16
@author Abdessalem Boukil
@authorEmail boukil98@gmail.com
In your html file
<script src="plotjs.js"></script>
<div id="container"></div>
var plane = new Plot({
container: document.getElementById('container')
});
plane.plot('4x+3');
The container must be a div or it would not be accepted
This are the default value of the plane's settings:
var setting = {
container: '', //Required
max: 21, //Integer
min: -21, //Integer
strokeThickness: 3, //Integer
strokeColor: 'black', //String
lineColor1: "#AAAAAA", //String Thick guidelines
lineColor2: "#DDDDDD", //String Secondary guidelines
backgroundColor: 'white', //String
zoom: true, //Boolean
navigation: true, //Boolean
height: '400px', //String
width: '400px', //String
errorReporting: true, //Boolean
foregroundColor: '#EEEEEE', //String
guidelines: true,
tickThickness: 2, //Integer
tickColor: 'black', //String
tickHeight: 16, //Integer
keyNavSpeed: 1, //Double
fontSize: 10, //Integer (in px)
fontColor: 'black',//String
dispCallback: function(disp){ return true; }, //Function
zommCallback: function(){ return true; } //Function
}
var plane = new Plot(setting);
This is the default setting of the function plot:
var plotDefault = {
borderColor: 'green', //String
borderThickness: 3, //Integer
equation: (typeof fn.equation === 'function') ? function(){ return; } : '', //Depends on the type of the equation variable
resolution: iteration
};
To see the full documentation open: http://abdesaslem.github.io/PlotJs/
- Destroy: Delete the plane
plane.destroy();
- destroyFunction: remove a function from the plane
var fn = plane.function('4x+23');
plane.destroyFunction(fn)
- Clear: clear the plane
plane.clear();