The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
||||
|
||||
Google Chart Integration
I would love to include a pie graph on my members profile, where users can enter two different values e.g. Height & Weight and it is automatically produced as a pie graph.
I noticed the Google Charts API and it seems like it would be possible to do, i'm not a coder so i'm not sure. Has anybody used Google Charts or knows how this would be possible? https://developers.google.com/chart/ |
#2
|
||||
|
||||
You would probably need to hire a PHP programmer for that. That would take some coding to have it work if its possible. Since you do not code it would probably be near to impossible for you to implement it yourself.
|
#3
|
|||
|
|||
This is not something hard to do but not a task for the average hobbyist. (Store submitted data in the database, retrieve on user profile and call Google Charts API.)
|
#4
|
||||
|
||||
Quote:
|
#5
|
||||
|
||||
Someone might be able to help you out, once you start coding it, and then when you run into issues, post your code and describe what issues you are having.
|
#6
|
|||
|
|||
I don't think it's very difficult, there's an example as part of the docs that you linked to above. But I don't understand what you want to display. You say "height and weight", but are you going to display those two values on the same chart, or do you want to display all users' heights on one pie chart and weights on another?
|
#7
|
||||
|
||||
I want to have them both on the same pie chart, one figure as weight and the other as body fat % as seen here: http://www.theironden.com/forum/members/24086-gfran5
thoughts on where i should start, or if anybody would be willing to start me off and give me a rough guide of what to do. |
#8
|
|||
|
|||
OK, I guess you want a pie chart showing percentage of lean mass vs. total body weight, which you're going to caluclate using height and weight?
Anyway, here's the google example (modified a little) which you can put in a template and it should display: PHP Code:
|
#9
|
||||
|
||||
I have already created those variables for Height and Weight needed, but i'm currently stuck with making the My Bodyspace page.
I have followed this guide on how to setup extra profile tabs, but i have no idea how to register my custom height and weight profile fields in the plugin so that they display on the template. my template currently has: HTML Code:
<div class="body_measurements"> <vb:if condition="$post['field8']"> <h2 style="display: inline;">H: {vb:raw post.field8}cm | </h2> <vb:else /> <h2 style="display: inline;">H: -- | </h2> </vb:if> <vb:if condition="$post['field7']"> <h2 style="display: inline;">W: {vb:raw post.field7} Lbs</h2> <vb:else /> <h2 style="display: inline;">W: -- </h2> </vb:if> </div> |
#10
|
|||
|
|||
Hmm...yeah, it would be nice if that guide had a little more detail about using the member's data. But going by a comment that appears later in the thread, I think it's in $prepared. So you'd have to add 'register' lines to the code that renders your template. For example you might be able to just do this:
Code:
$templater = vB_Template::create('memberinfo_block_test'); $templater->register('selected_tab', $selected_tab); $templater->register('test_tab_content', $test_tab_content); $templater->register('userdata', $prepared); $template_hook['profile_tabs'] .= $templater->render(); |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|