Skip Navigation

[Resolved] Creating charts from custom field data

This support ticket is created 5 years, 4 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

Tagged: 

This topic contains 3 replies, has 3 voices.

Last updated by Beda 5 years, 4 months ago.

Assisted by: Shane.

Author
Posts
#1323193

I'd like to allow my users to fill in custom fields on a post with numbers indicating the percentages of student satisfaction. I would like to then write a view which would display this information as a graph.

Is this possible? As in, can I take some ready graph code, e.g. from here (hidden link), and insert Toolset custom field shortcodes in place of the variables? Then the shortcodes would pull the data my users enter.

I'm not sure how to integrate the JS from the page linked though... Is this at all possible? If not, can you recommend some other option for displaying numbers entered in custom fields as a graph?

Shane replied to a previous version of this ticket suggesting using this plugin: https://wordpress.org/plugins/visualizer/
(see here: https://toolset.com/forums/topic/creating-charts-from-custom-field-data/)

Unfortunately, Shane then closed that ticket leaving me no opportunity to reply. I checked out this plugin and alas, it doesn't seem to allow me to use custom fields in the free version. Could there be some other, more useful solution?

#1323345

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Hi John,

Thanks for getting in touch.

The issue why the ticket was closed was because it was opened as a chat ticket. Unfortunately there was no response from you in the first 10 minutes of opening the ticket.

However helping you with the code to setup this would be out of the scope of our support forum. This is why the suggestion was made to use a plugin instead.

The plugin that was suggested, may or may not meet your requirements.

Thanks,
Shane

#1323563

I don't know the difference between a chat ticket and a regular ticket - when I was opening it, it looked exactly the same. Either way, it seems quite weird to not leave people an chance to reply because they missed a 10-minute window of opportunity.

I appreciate that this might not be possible, and would be perfectly happy with an answer 'this can't be easily done because of X'.

#1323615

I just wanted to add, it is not possible with Toolset natively.
This is because Toolset doesn't incorporate any mechanisms to output any chart or graph. It allows only to display data in HTML structures, which you can add liberally in Toolset's Views Loop Editors, or Content Templates.

Hence, you can take a graph renderer and populate that with Toolset Data, as you explained above.
I've elaborated on such approaches in the past, even though, it's not something we suggest directly, or can support - it may be of use to you:
https://toolset.com/forums/topic/charts-and-graphs-with-toolset/#post-361492

Other suggested solutions (less elaborated):
https://toolset.com/forums/topic/charts-and-graphs/#post-180333

Note, it's not really suggested to mix in JavaScript in HTML editors, which is what you'll need to do if you follow my above example.
It works, but WordPress doesn't love it, and it may stop working.

Better would be, to take the API of those graph plugins (some JS Graph API) and populate it with Toolset Data using its API:
https://toolset.com/documentation/programmer-reference/views-api/

Note that Views can be set so to return "raw" data, allowing you to return {} JSON valid script for example, which is often required to populate charts.
You can find that when editing the Loop of a view with the Wizard, it's named "List output"