Generic Plugin
Contains the template code to include your own plugin in a sidebar of the chart.
To use:
- Rename the parent folder of this file to the name you want to use for the plugin.
- Rename the
genericPlugin
configuration from the default configuration with your new plugin name.
- Customize the
toggleMarkup
property.
- Set the
location
property to "top" or "right".
- You may add extra properties if you wish. They will be available in the render and unrender functions (see below).
- Import this file (plugin.js) into your template.
- Add your custom code, images and css. You should not need to modify ./bootstrap.js in any way.
- in class
ThisPlugin
below, render
method is called when the panel is revealed.
- in class
ThisPlugin
below, unrender
method is called when the panel is hidden.
- Both functions have instance properties available for access:
- Place your markup in
this.node
.
- this.params
contains the properties from default configuration.
- container
: location of toggle button.
- location
: whether to put the plugin area on the top or the side of the chart.
- toggleMarkup
: HTML markup for the toggle button.
- stx
: the ChartEngine object.
- context
: the chart user interface context.
- this.pluginName
is the name of your component.
ThisPlugin
ships with demo render and unrender functionality.
- Replace the string "genericPlugin" in the style names in the css file (ui.css) with your plugin name.
You can add more than one custom plugin. Just copy the genericPlugin and follow the same pattern above.