K2 vs flashChart 2 years 6 months ago #143964

Hi, id like to use flashChart - www.jschmidt-systemberatung.de/index.php?option=com_content&view=article&id=176&Itemid=240&lang=en#overview
with K2 to show graphs generated from data saved in extrafields. But know next to nothing about databases and proper coding, so don't know how to call data from certain extra field in database.

Created simple sample page at vgamuseum.info/index.php/test-area where it works with standard data like number of hits, code looks like this.

{flashchart height="10000" width="90%" data="database" sql="Select title, hits From umhtg_k2_items Order By hits Asc" tooltip="#val# MPixel/s" title="Pixel Fillrate"}test007{/flashchart}

Now i need replace this part - sql="Select title, hits From umhtg_k2_items Order By hits Asc" - but cant simply replace "hits" for extra_fields, because data are stored there in this format:


So i need to call only one value from one id (in mine testing page for example i need value from id 29).

Is there any way how to do it?

Here is also image from phpmyadmin to see how looks data in extra_fields -
Last Edit: 2 years 6 months ago by Cz Vlask. Reason: x
  • Lefteris
  • Lefteris's Avatar
  • Moderator
  • Posts: 9660

K2 vs flashChart 2 years 6 months ago #143969


You need some PHP code to do this. The data in the field "extra_fields" are encoded in JSON. This means that you can use PHP's json_decode function ( php.net/manual/en/function.json-decode.php ) to turn this into an object and access the variables you wish.
IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Moderators: william white

Who Is Online

Total users online: 9 Members and 5774 Guests Online
Alex Walker Frode John Keith Mountifield Marian Wężycki Robert j Wall Tim Paulson damir william white
Legend ::   Site Administrator Global Moderator Moderator Banned User Guest
  • Total Messages: 138565 | Total Subjects: 36484
  • Total Sections: 6 | Total Categories: 32
  • Today Open: 2 | Yesterday Open: 2
  • Today Total Answer: 3 | Yesterday Total Answer: 26
Powered by Kunena Forum