optionally hide raw data when using preDrawSeriesHooks

roelof avatarroelof created an issue

hi,

we've developed a new plugin, moving average, for jqplot. on some of the graphs we would like to hide the raw data and only show the moving average.

we have two choices:

  1. hide the original series in the preDrawSeriesHooks. this works well, but then the addLegendRowHooks is not being called any more
  2. apply the moving average to the data series before passing it to jqplot. this would work as well. i guess this would be our option for now.

the feature request is as follows:

  1. call addLegendRowHooks even if the series is disabled as a plugin may have disabled the series after adding additional value.
  2. make this configurable so that one could enable the plugin and disable the series, eg. :
graphSeries = {
  show:false,
  movingAverage: {show:true, label:'Test'}
}

any other options we may consider?

Comments (6)

  1. Chris Leonello

    I can modify the code so that addLegendRow is called even if series is not shown. That is a good idea in general.

    For having separate configuration arguments to your plugin, I don't think I need to change anything. Your plugin could hook into the postParseSeriesOptionsHooks and parse out any options it needs at that point.

    Let me know if I've understood correctly.

  2. roelof

    hi chris,

    i am already using postParseSeriesOptionsHooks and that is working great. as for the 2nd request; i was hoping that one would not need have to hide the original series in the plugin, i.e. that it could be done in a generic fashion. having said that, that is not such a big deal, as we could add an option to the plugin to choose whether to hide the original data or not.

    thanks for the quick response and looking forward to the next release!

    btw, feel free to use the attached moving average plugin in any way you see fit.

  3. Log in to comment
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.