Forum Replies Created

Viewing 13 replies - 301 through 313 (of 313 total)
  • Forum: Plugins
    In reply to: [M Chart] Extra plotOptions
    Plugin Author methnen

    (@methnen)

    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.

    Forum: Plugins
    In reply to: [M Chart] Extra plotOptions
    Plugin Author methnen

    (@methnen)

    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.

    Forum: Plugins
    In reply to: [M Chart] Extra plotOptions
    Plugin Author methnen

    (@methnen)

    Hey @ocmpixvd

    I’d start by checking out the docs:

    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.

    Plugin Author methnen

    (@methnen)

    Closing since there’s been no reply from Raisinli.

    Plugin Author methnen

    (@methnen)

    Marking this as resolved since there’s been no response from the original poster.

    Plugin Author methnen

    (@methnen)

    Marking this as resolved since there’s been no response from the original poster.

    Plugin Author methnen

    (@methnen)

    Hey @raisinli,

    That’s a strange one. Looking in the components directory do you see a class-m-chart.php file? There’s definitely one in the zip file but that error is implying that PHP can’t find the file there.

    I might try simply removing the entire m-chart directory re-downloading the plugin and trying to reinstall it.

    Plugin Author methnen

    (@methnen)

    Also just checked out that wowtoken.info site and they’re using Highstock to display their charts which honestly lends itself to giant data sets like this much better than Highcharts does.

    Plugin Author methnen

    (@methnen)

    So I had a moment and took a look at your file. First that’s a huge number of data points and you WILL run into Highcharts having a bit of an issue displaying a data set that that large in an optimal manner. And the plugin might be a little slow

    That said you can get it to work but you’ll need to understand how M Chart and Highcharts expects the data.

    A few notes:
    The Region column isn’t something that lends itself well to a chart since it’s not a chartable value it’s more of a label. If Region is an important thing to include I’d do a chart per region. North American WoW Token Prices, EU WoW Token Prices, Etc…

    OR you could orient the data by region. (i.e. a column for each region with the prices underneath and the dates on the other axis.

    Finally M Chart expects the first cell to be empty in data sets with multiple sets of values. That’s how it tells you’ve got multiple columns of data with labels on both axis. That would allow you to graph the different regions together but that only works well if you can match up the dates, i.e. you have a data point for each date.

    With this data set I’d still fall back on doing this with a chart per region especially since your date/time values don’t match up with each other from region to region.

    So that leaves you with three charts like so:
    https://methnen.com/misc/wow-token-csvs/canada_token_prices.csv
    https://methnen.com/misc/wow-token-csvs/eu-token-prices.csv
    https://methnen.com/misc/wow-token-csvs/north-america-token-prices.csv

    Highcharts will be able to graph them a bit better too since they’re much smaller on their own.

    Plugin Author methnen

    (@methnen)

    Deexgnome,

    I’ll take a look at that CSV today probably when I have a moment and see if I can identify what might be wrong. In the meantime did you take a look at the docs?

    https://github.com/methnen/m-chart/wiki

    Plugin Author methnen

    (@methnen)

    Hey mvanderhorst,

    The exporting.js bit is only used in the admin panel where the chart gets converted into a high res PNG automatically. That PNG is then attached to the post and saved into the Media section of WordPress. If you wanted to include it in the front end you’d need to do that yourself and then filter the chart options to have the export feature turned on.

    Thread Starter methnen

    (@methnen)

    Thanks, yes, I realized how stupid my question was anyway about 5 minutes after I asked it. I did get it to work within a plugin which I like because I didn’t want to dirty up the template that much but either way I was making it out to be more complicated than it really was.

    Thread Starter methnen

    (@methnen)

Viewing 13 replies - 301 through 313 (of 313 total)