Graphina Documentation

Dynamic Charts: A Comprehensive Guide


How to Retrieve Dynamic Data Using SQL-Builder

Introduction

This guide will walk you through the fastest way to integrate dynamic WordPress charts from a MySQL database using PHP.

Previously, we discussed what dynamic data is and the commonly used data sources. Now, it’s time to put that knowledge into action by converting static charts into dynamic ones using SQL Builder.

Fetching Capital Column Data

To enable uppercase column names, toggle the option as shown in the image.

Note:

  • If the offset and limit are unnecessary, set them to null.
  • You can extract data from any table within your existing WordPress database.

Steps to Convert Static Charts into Dynamic Charts Using SQL Builder

Step 1: Select the Chart

  • Open Graphina – WordPress Chart Plugin.
  • Choose the chart where you want to display dynamic data (e.g., Line Chart).

Step 2: Change Data Option from Manual to Dynamic

  • Navigate to the chart data option.
  • Switch from “manual” to “dynamic”.
  • A message stating “No Data Available” will appear until a data source is selected.

Step 3: Set Dynamic Data to SQL

  • Select the Dynamic Data Option.
  • Change the type to SQL Builder.
  • A text area will appear for entering raw SQL queries.
  • As you input the SQL query, the data executes automatically.

Step 4: Select the Table

  • Click on “Select Mode” and choose “Table”.
  • A drop-down list of available tables will appear.
  • Select the relevant table to instantly view the data.

Step 5: Finalizing the SQL Data Integration

  • In SQL Builder, click “External”.
  • Choose the data table from the dropdown list.
  • Edit the SQL Raw Query as needed.
  • Set the Y-axis column to define how data is structured in the chart.
  • Your SQL Builder Chart is now successfully configured!

How to Retrieve Dynamic Data Using CSV

Fetching Dynamic Data from a Remote CSV File

This tutorial will show you how to create a WordPress chart using a CSV file within 2 minutes.

Prerequisites

  • Ensure the allow_url_fopen directive is enabled in your php.ini file.

Steps to Create WordPress Charts Using CSV Files

Step 1: Select the Chart

  • Open Graphina – WordPress Chart Plugin.
  • Choose a chart (e.g., Area Chart).

Step 2: Switch Data Option from Manual to Dynamic

  • Change the chart data option from “manual” to “dynamic”.
  • The “No Data Available” message appears until a data source is selected.

Step 3: Add Data from a CSV File

  • Select the Dynamic Data Option.
  • Change the type to Remote CSV.
  • Paste the CSV file URL into the designated field.
  • The chart updates automatically.
  • Modify chart data elements to fine-tune the visualization.

Your dynamic CSV chart is now ready!


How to Retrieve Dynamic Data Using Google Sheets

Google Sheets offers a wide range of charting options. However, if you want to integrate these charts into WordPress, this guide will show you how to do so effortlessly.

Prerequisites

  • Ensure the allow_url_fopen directive is enabled in your php.ini file.

Steps to Create WordPress Charts Using Google Sheets

Step 1: Select the Chart

  • Open Graphina – WordPress Chart Plugin.
  • Choose the desired chart.

Step 2: Change Data Option from Manual to Dynamic

  • Navigate to chart data options.
  • Switch from “manual” to “dynamic”.

Step 3: Add Google Sheet Data

  • Select the Dynamic Data Option.
  • Change the type to Google Sheet.
  • Copy and paste the Google Sheets URL.
  • Publish the sheet to the web and convert it to CSV format.
  • Modify the chart data elements to ensure proper visualization.

Your dynamic Google Sheets chart is now successfully configured!


How to Retrieve Dynamic Data Using an API

This guide will help you integrate external APIs with Graphina to generate dynamic WordPress charts effortlessly.

Understanding API Authentication

Some APIs require an API Key or Header Token for authorization.

Steps to Create WordPress Charts Using External APIs

Step 1: Select the Chart

  • Open Graphina – WordPress Chart Plugin.
  • Choose a chart to visualize API data.

Step 2: Switch Data Option from Manual to Dynamic

  • Change chart data options from “manual” to “dynamic”.

Step 3: Add External API Data

  • Select the Dynamic Data Option.
  • Change the type to API.
  • Paste the API URL in the designated field.

Step 4: Configure Data Elements

  • Modify chart data elements based on API response structure.
  • The chart updates automatically as per API data.

Your dynamic API-powered WordPress chart is now set up!


Conclusion

With Graphina – WordPress Chart Plugin, integrating dynamic data from SQL, CSV, Google Sheets, and APIs is seamless and efficient. Whether fetching data from a database, an external file, or an API, this guide ensures you can create stunning dynamic charts effortlessly.

Stay tuned for more tutorials on leveraging Graphina’s powerful capabilities! 🚀