methnen
Forum Replies Created
-
Forum: Reviews
In reply to: [M Chart] Best Charting PluginI appreciate the super nice feedback on M Chart.
It’s a bit of a labor of love on my part so the occasional kudos is always appreciated. 🙂
As for the UI controls overriding something in a theme, that actually shouldn’t happen. Theme stuff is applied AFTER the base chart values and settings have all been generated.
It’s the last thing done before the chart values are output into the Javascript for the given chart.
I’d be curious to see what issue you ran into with regards to this.
In any case thanks again for the very nice feedback.
- This reply was modified 5 years, 9 months ago by methnen.
Forum: Plugins
In reply to: [M Chart] Different settings for different languages@pizzacolomba The plugin doesn’t support this natively but it would be relatively easy to add via one of the existing filter hooks. I’m assuming you are using Highcharts? I’m not sure Chart.js even supports changes to comma/decimal uses it’s latest version.
In any case there’s the m_chart_chart_options filter hook:(
https://github.com/methnen/m-chart/wiki/Action-and-filter-hooks#m_chart_chart_options
If you wanted to add something like this to your functions.php file in your theme I imagine it would work:
function filter_m_chart_chart_args( $chart_args, $post, $post_meta, $args ) { if ( ADD CONDITION HERE FOR ALTERNATE LANGUAGE ) { $chart_args['lang'] = array( 'decimalPoint' => '.', 'thousandsSep' => ',', 'numericSymbols' => array( 'K', 'M', 'B', 'T', 'P', 'E', ), 'numericSymbolMagnitude' => '1000', ); } else { $chart_args['lang'] = array( 'decimalPoint' => '.', 'thousandsSep' => ',', 'numericSymbols' => array( 'K', 'M', 'B', 'T', 'P', 'E', ), 'numericSymbolMagnitude' => '1000', ); } return $chart_args; } add_filter( 'm_chart_chart_args', 'filter_m_chart_chart_args', 10, 4 );Obviously you’d have to tweak the first conditional to check for the alternate language however is appropriate for your plugin, and then update the language options to match.
Does that get you anywhere?
- This reply was modified 5 years, 10 months ago by methnen.
Forum: Plugins
In reply to: [M Chart] Charts not showing on frontendAlright, the latest version: 1.7.11 that I just pushed lived should solve this issue going forward for anyone else.
Forum: Plugins
In reply to: [M Chart] Charts not showing on frontendI think it might be a change in WP 5.5.
It made a lot of jQuery related changes and this might be one I missed. I’ll look at figuring out a way to make it work better even when jQuery is in the footer.
Forum: Plugins
In reply to: [M Chart] Charts not showing on frontendHey @twibi
Taking a quick look it appears that the chart code isn’t finding jQuery before it tries to use it.
I looked and it appears your theme is loading jQuery into the footer.
Any way you could move that initial jQuery call into the header and see if that fixes it?
Forum: Plugins
In reply to: [M Chart] Number formatting.Closing as I believe this has been dealt with as well as possible at this point.
Forum: Plugins
In reply to: [M Chart] Number formatting.I’d ask Highsoft. They’re the only ones who can say for sure if what they do would require a commercial license.
Forum: Plugins
In reply to: [M Chart] Number formatting.Seems like that might work. If I’m understanding it right, it still looks like you’d have to enter the data in the xxx,xxx,xxx.xx format. But that would flip the display of it around to use commas in the decimal place.
They’re using another library to handle formatting rather than trying to just do a string replacement which is good honestly but you’ll need to include it in the page as well.
As for implementing it inside the plugin you’d want to probably call the code using an action hook.
Maybe this one: m_chart_after_chart_args
Then you could modify the chart settings to use the library when rendering the numbers.
Still yes, pain in the neck Chart.js doesn’t already support this stuff natively.
Chart.js is still fairly young I think and it’s just missing some features like this. Highcharts already includes native comma decimal support. If you aren’t working on a commercial project that would probably be an easier choice:
Forum: Plugins
In reply to: [M Chart] Number formatting.That adds commas into the tooltip display. It does not sadly allow for the commas to exist in the actual data. So you’d have to enter the data in with decimals and then use that to flip it around on the display end. But even then it would only affect the tool tips.
I don’t think that’s an actual workable solution sadly.
It’s a workaround and not even one that fixes all of the places where the numbers get displayed.
Forum: Plugins
In reply to: [M Chart] Number formatting.I don’t believe Chart.js has built in comma decimal support.
I tried a number in that format inside of a chart and it does not appear that Chart.js knows what to do with it.
Forum: Plugins
In reply to: [M Chart] Automatically change in chart from CSV file?Closing since op has never replied.
Forum: Plugins
In reply to: [M Chart] Shortcake UI is not rendered.This issue was resolved over email.
Forum: Plugins
In reply to: [M Chart] Download and zoom options.I don’t seem to have gotten anything. Care to send again?
Forum: Plugins
In reply to: [M Chart] Download and zoom options.I’d be happy to take a look if this is something reachable from my direction.
Could be any number of things going on.
Feel free to email me at jamie AT methnen.com
Forum: Plugins
In reply to: [M Chart] Download and zoom options.scripts should be enqueued on ‘init’ at the earliest any sooner and you’re breaking the rules according to WP docs.
The scripts are registered on init as well at the regular priority so you’ll want to make sure you enqueue them after their registered or else WP won’t have the registered script yet.
So something like this in your functions.php should work:
function theme_highcharts_script_enqueue() { wp_enqueue_script( 'highcharts-exporting' ); } add_action( 'init', 'theme_highcharts_script_enqueue', 20 );