wppompey / pompey-chart

Displays a chart of WordPress Portsmouth Meetup attendees over time
0 stars 0 forks source link

Create a generic [chart] shortcode #4

Open bobbingwide opened 3 years ago

bobbingwide commented 3 years ago

I have several uses for Charts. One option is to use the Visualiser plugin, which uses chartjs. This is OK, except I'll need the premium version in order to use website content. Another is to make a generic version of the shortcode that works in a similar manner to the logic in pompey_chart_data(), which returns the data from the shortcode content, then extend it to use dynamic data provided by a variety of methods.

A future requirement will be to implement the shortcode as a dynamic block.

Requirement

Proposed solution

eg

[chart title=test labels=1 tooltips=4 height=250]Date,A,B
2020-01,1,2,January
2020-02,4,5,February
2020-03,7,8,March
[/chart]

where atts are:

Attribute Values Purpose
type Line Bar Pie Chart type
height 450px Height of the chart

Future use:

Attribute Values Purpose
title Title for the chart
labels 1 Column for the x-axis labels
tooltips 4 Column for the Tooltips
bobbingwide commented 3 years ago

I have several uses for Charts.

Here's a small selection of Charts to consider creating: Charts for oik-plugins on wordpress.org.

Component Chart type Notes Status
myplugins Bar Latest downloaded and Active by plugin https://s.b/wordpress/shortcode_example/my-plugins-charts/
myplugins Pie Top 6 Pie chart https://s.b/wordpress/shortcode_example/my-plugins-charts/
myplugins Stacked bar Downloads by plugin in last 6 months https://s.b/wordpress/shortcode_example/my-plugins-charts/
myplugins Line Downloads by plugin for all time

Charts to measure performance improvements

Component Chart type Notes Status
oik-bwtrace Line Server performance https://s.b/hm/wordpress-performance-4-5-to-4-7/ and other posts
oik-bwtrace Pie Transaction type
pompey-chart Line Meetup statistics Done [pompey_chart]
uploads-bar-chart Bar Uploads dir size by month

Charts for https://top-10-wp-plugins.com

Component Chart type Notes Status
wp-top12 Line Total downloads Prototyped
wp-top12 Bar Last updated Prototyped
wp-top12 Bar Version compatibility. Required and Tested counts Prototyped
wp-top12 Pie Star ratings - 5 to 1 Prototyped

Charts for Performance

Component Chart type Notes Status
Performance Bar Image compression by quality