K2 vs flashChart 2 years 4 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 4 months ago by Cz Vlask. Reason: x
  • Lefteris
  • Lefteris's Avatar
  • Moderator
  • Posts: 9660

K2 vs flashChart 2 years 4 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: 22 Members and 4253 Guests Online
Beppe De Lorenzis Christophe BERTRAND CloudByte Davy Donnell Holness Fairtech Francesco Gary Hansen Goble002 Inter-Ibex Jos Larry Mitchell Mohammed Refat Reymond Startprogram Tomáš Václ Uzi YODAstudio michael razen site william white
Legend ::   Site Administrator Global Moderator Moderator Banned User Guest
  • Total Messages: 137434 | Total Subjects: 36267
  • Total Sections: 6 | Total Categories: 32
  • Today Open: 6 | Yesterday Open: 3
  • Today Total Answer: 8 | Yesterday Total Answer: 22
Powered by Kunena Forum