Title: Extra plotOptions
Last modified: August 30, 2016

---

# Extra plotOptions

 *  Resolved [compixvd](https://wordpress.org/support/users/compixvd/)
 * (@compixvd)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/extra-plotoptions/)
 * I need to know where i can configure plotOptions with extra options to render
   chart, or where to write this code.
 * Thanks
 * [https://wordpress.org/plugins/m-chart/](https://wordpress.org/plugins/m-chart/)

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [methnen](https://wordpress.org/support/users/methnen/)
 * (@methnen)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/extra-plotoptions/#post-6331176)
 * Hey @ocmpixvd
 * I’d start by checking out the docs:
 * [https://github.com/methnen/m-chart/wiki](https://github.com/methnen/m-chart/wiki)
 * There’s a variety of filters and action hooks you can plug into to tweak things.
 * If there’s something you’d like me to add in the customization sense let me know
   via a Github issue and I’ll be sure to take a look.
 *  Thread Starter [compixvd](https://wordpress.org/support/users/compixvd/)
 * (@compixvd)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/extra-plotoptions/#post-6331183)
 * Hi methnem.. thanks for the response,
    I was looking in m-chart wiki but sorry
   i can’t figure how do something like this:
 * [http://jsfiddle.net/philfreo/Nkeep/85/](http://jsfiddle.net/philfreo/Nkeep/85/)
 * Can you help me plis
 * Thanks in advance
 *  Plugin Author [methnen](https://wordpress.org/support/users/methnen/)
 * (@methnen)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/extra-plotoptions/#post-6331185)
 * So you want only the first series to be shown by default and then yo want subsequent
   ones to be toggled on click. Like in the jsfiddle?
 * You’d need to use the `m_chart_chart_args` filter hook. Then you’d loop through
   the series and set all but the first to be `visible: false` then you’d need to
   add the event to the chart args.
 * The value passed by `m_chart_chart_args` matches up with the Highcharts chart
   args objects only it’s a PHP array which then gets converted to a JSON string
   after the fact.
 * You’ll see the series in there. You could add the visible false value to them
   with something like this:
 *     ```
       foreach ( $chart_args['series'] as $key => $set ) {
       	if ( 0 == $key ) {
       		continue;
       	}
   
       	$chart_args['series'][ $key ]['display'] = false;
       }
       ```
   
 * Then you would add the event stuff with something that looks like this:
 *     ```
       $chart_args['series']['events']['legendItemClick'] = 'function(event) {
           var selected = this.index;
           var allSeries = this.chart.series;
   
           $.each(allSeries, function(index, series) {
               selected == index ? series.show() : series.hide();
           });
   
           return false;
       }';
       ```
   
 * Hopefully I’m making sense.
 * Keep in mind I haven’t tested any of that code so I might have made a typo or
   syntax error in there or something. Or I might be remembering the array structure
   a bit wrong. But that should point you in the right direction.
 *  Plugin Author [methnen](https://wordpress.org/support/users/methnen/)
 * (@methnen)
 * [10 years, 10 months ago](https://wordpress.org/support/topic/extra-plotoptions/#post-6331186)
 * Also, it’s certainly possible you could build a UI around that so this was all
   done via something a normal user could do. But I’m not sure if that’s something
   in your comfort zone. If that’s a feature you’d like to see make a feature request
   on Github and I’ll definitely take it under advisement. 🙂
 * Or maybe someone else will build it in.
 *  Plugin Author [methnen](https://wordpress.org/support/users/methnen/)
 * (@methnen)
 * [10 years, 9 months ago](https://wordpress.org/support/topic/extra-plotoptions/#post-6331267)
 * Closing this since there’s been no feedback from the OP for some time.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Extra plotOptions’ is closed to new replies.

 * ![](https://ps.w.org/m-chart/assets/icon-256x256.png?rev=3472197)
 * [M Chart](https://wordpress.org/plugins/m-chart/)
 * [Support Threads](https://wordpress.org/support/plugin/m-chart/)
 * [Active Topics](https://wordpress.org/support/plugin/m-chart/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/m-chart/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/m-chart/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [methnen](https://wordpress.org/support/users/methnen/)
 * Last activity: [10 years, 9 months ago](https://wordpress.org/support/topic/extra-plotoptions/#post-6331267)
 * Status: resolved