Greencharts

Greencharts

Wordpress plugin

Install on Wordpress

App Details

This WordPress plugin allows you to easily add interactive charts to your website, using data from the global-warming.org API and the ChartJs library. The plugin has built-in mechanisms such as server cache, lazy load and client cache, which work together to reduce the CO2 emissions caused by internet/hardware usage per chart view.

Usage

Once the plugin is installed and configured, you can add chart shortcodes to your pages and posts. The available shortcodes are:

  • [greencharts-chart type="temperature"]: Displays a line chart of global temperature change over time.
  • [greencharts-chart type="co2"]: Displays a line chart of CO2 emissions by country.
  • [greencharts-chart type="methane"]: Displays a line chart of global methane gas emissions.
  • [greencharts-chart type="oceanwarming"]: Displays a line chart of global ocean warming.

You can customize the appearance of the charts using the ChartJs library’s options and callbacks using wordpress js hooks. Visit ChartJs documentation for more information.

Support

If you have any issues with the plugin, please open a Github issue or contact us via email. We will do our best to assist you.

Contribution

If you would like to contribute to the development of this plugin, please fork the repository and submit a pull request.

Disclaimer

This plugin is provided “as is” without warranty of any kind, either express or implied. Global warming.org and ChartJs library do not endorse this plugin and are not responsible for any damages or losses that may result from its use.

Plugin hooks

php [docs](https://developer.wordpress.org/plugins/hooks/)

Use the apply_filters function to set a transient value to false. This will disable caching for the greencharts data.

apply_filters('greencharts_transient_disableCache', false); 

Use the apply_filters function to set the lifespan of transient. The filter can be used to modify the lifespan of the transient before it is set. The transient is used to cache remote API requests, default transient is 1 month. The lifespan should be the number of seconds, see $expiration parameter of wordpress set_transient function

apply_filters('greencharts_transient_lifespan', $this->lifespan, $this); 

Use the apply_filters function to set a logger value to true. This will enable logging for the greencharts data.

apply_filters('greencharts_logger_shouldLog', defined('WP_DEBUG') && true === WP_DEBUG); 

Use the apply_filters function to set a verbose value to true. This will enable verbose logging for the greencharts data.

apply_filters('greencharts_logger_shouldBeVerbose', false); 

Uses the apply_filters function to alter ajax resposes data used by charts. Useful if you need to add more charts.

apply_filters('greencharts_ajax_chartsApi',$charts->getChartsDataByType($type), $type); 

js [docs](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-hooks/)

Remember to use wp.hooks.addFilter BEFORE greencharts js load.

This code applies a filter to the chartConfig object which is used to create a greencharts_js_chartConfig chart on the canvas. The filter is used to modify the chartConfig object so that it can be used to create a customized chart.

globalHooks.applyFilters("greencharts_js_chartConfig", chartConfig, canvas); // usage example: wp.hooks.addFilter( "greencharts_js_chartConfig", "defaultHooks", (chartConfig, canvas) => { console.log("THEME FILTER", chartConfig, canvas.dataset.type); chartConfig.data.datasets[0].backgroundColor = "blue"; return chartConfig; } ); 

This code applies a filter to the debug var that control operations logging. The filter is set to false, meaning that any code related to greencharts_js_debug will not be logged in the browser js console.

globalHooks.applyFilters("greencharts_js_debug", false), // usage example: wp.hooks.addFilter("greencharts_js_debug", "defaultHooks", () => true); 

This code applies a filter to the “greencharts_js_errorMessage” string. The filter takes in the string, along with the data and error objects, and returns a modified version of the string. This is useful for customizing error messages based on different scenarios.

globalHooks.applyFilters( "greencharts_js_errorMessage", "Something goes wrong during chart loading. Please retry later", data, error ); 

This code applies a filter to the text of a “Reset zoom” button on a canvas element. This allows developers to customize the text of the button.

options.globalHooks.applyFilters( "greencharts_js_resetZoomButtonText", "Reset zoom", canvas ); 

This code applies a filter to the text of a “Load chart” button on a canvas element. This allows developers to customize the text of the button.

options.globalHooks.applyFilters( "greencharts_js_loadButtonText", "Load chart", canvas );<h3>Assets attribution</h3> 

– Image by (rawpixel.com)[https://www.freepik.com/free-vector/social-media-analysis-design-graphs_16323246.htm#query=minimal%20charts&position=3&from_view=search&track=ais] on Freepik
– Image by (Freepik)[https://www.freepik.com/free-vector/green-energy-buildings_713297.htm#query=eco%20green&position=31&from_view=search&track=ais]

Pricing

Starting from $0 per month.

Check Out the TikTok Carousel Widget

By Common Ninja

TikTok CarouselTry For Free!

App Info

Rating

Reviewers

No reviews

Tags

ChartJS
charts
Green

Developed By

mbaroncini

Quick & Easy

Find the Best Wordpress plugins for you

Common Ninja has a large selection of powerful Wordpress plugins that are easy to use, fully customizable, mobile-friendly and rich with features — so be sure to check them out!

Testimonial

Testimonial plugins for Wordpress

Contact Form

Contact Form plugins for Wordpress

Maps

Maps plugins for Wordpress

Translation

Translation plugins for Wordpress

Chat

Chat plugins for Wordpress

Slider

Slider plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Contact

Contact plugins for Wordpress

Galleries

Galleries plugins for Wordpress

SEO

SEO plugins for Wordpress

Forms

Forms plugins for Wordpress

Comments

Comments plugins for Wordpress

Backup

Backup plugins for Wordpress

Privacy

Privacy plugins for Wordpress

Optimize

Optimize plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Comments

Comments plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Social Sharing

Social Sharing plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Video Player

Video Player plugins for Wordpress

popup

popup plugins for Wordpress

SiteMap

SiteMap plugins for Wordpress

Payment

Payment plugins for Wordpress

Coming Soon

Coming Soon plugins for Wordpress

Inventory

Inventory plugins for Wordpress

Testimonials

Testimonials plugins for Wordpress

Portfolio

Portfolio plugins for Wordpress

Membership

Membership plugins for Wordpress

Forms

Forms plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Events Calendar

Events Calendar plugins for Wordpress

Sliders

Sliders plugins for Wordpress

Analytics

Analytics plugins for Wordpress

Reviews

Reviews plugins for Wordpress

Security

Security plugins for Wordpress

Ads

Ads plugins for Wordpress

Music Player

Music Player plugins for Wordpress

Countdown

Countdown plugins for Wordpress

Email Marketing

Email Marketing plugins for Wordpress

Membership

Membership plugins for Wordpress

Ecommerce

Ecommerce plugins for Wordpress

Customer Support

Customer Support plugins for Wordpress

Video Player

Video Player plugins for Wordpress

Tabs

Tabs plugins for Wordpress

Social Feeds

Social Feeds plugins for Wordpress

Common Ninja Apps

Some of the best Common Ninja plugins for Wordpress

Browse our extensive collection of compatible plugins, and easily embed them on any website, blog, online store, e-commerce platform, or site builder.

TikTok Carousel for Wordpress logo

TikTok Carousel

Show TikTok videos with a TikTok carousel that arranges clips in a smooth, customizable layout to boost engagement and keep visitors watching.

Mega Footer for Wordpress logo

Mega Footer

Create a mega footer that organizes navigation links, contact info, logos, social icons and improves usability and site structure.

LinkedIn Feed Carousel for Wordpress logo

LinkedIn Feed Carousel

Show LinkedIn posts with a LinkedIn feed carousel that auto updates, presents content in a smooth layout, and keeps visitors engaged.

Image Grid Slider for Wordpress logo

Image Grid Slider

Showcase visuals with an image grid slider that blends a grid layout and carousel motion to create a dynamic, customizable, mobile friendly display.

Size Chart for Wordpress logo

Size Chart

Add a flexible size chart with visual guides and category tabs to help users choose accurate measurements while shopping.

WhatsApp Chat for Wordpress logo

WhatsApp Chat

Add WhatsApp Chat to your site to communicate with visitors, deliver instant support, and create a smoother, more trustworthy user experience.

Glassdoor Reviews for Wordpress logo

Glassdoor Reviews

Show Glassdoor reviews to highlight employee feedback, strengthen employer brand, and help candidates trust your company.

Tabs for Wordpress logo

Tabs

Use tabs to organize content into clear sections, improve navigation, and help visitors switch between topics quickly for a smoother user experience.

Support Form for Wordpress logo

Support Form

Use a support form that lets customers submit tickets, saves each request, sends notifications, and helps you manage support more efficiently.

Facebook Feed for Wordpress logo

Facebook Feed

Show Facebook posts in a live Facebook feed that keeps content fresh, boosts social proof, and helps visitors engage more with your brand.

Vimeo Feed for Wordpress logo

Vimeo Feed

Show Vimeo videos in a Vimeo feed that keeps content fresh and helps visitors discover more of your video library.

My Reviews on Amazon for Wordpress logo

My Reviews on Amazon

Show your Amazon product reviews with My Reviews on Amazon to build trust, boost credibility, and help visitors make confident purchase decisions.

More plugins

plugins You Might Like

Discover Apps By Platform

Discover the best apps for your website

WordPress
Wix
Shopify
Weebly
Webflow
Joomla
PrestaShop
Shift4Shop
WebsiteX5
MODX
Opencart
NopCommerce

Common Ninja Search Engine

The Common Ninja Search Engine platform helps website builders find the best site widgets, apps, plugins, tools, add-ons, and extensions! Compatible with all major website building platforms - big or small - and updated regularly, our Search Engine tool provides you with the business tools your site needs!

Multiple platforms