Keyword

K2 vs flashChart

  • Cz Vlask
  • Cz Vlask's Avatar Topic Author
  • Offline
  • New Member
More
8 years 10 months ago - 8 years 10 months ago #143964 by Cz Vlask
K2 vs flashChart was created by Cz Vlask
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:

[{"id":"1","value":"1"},{"id":"2","value":"Avenger"},{"id":"3","value":["6","8"]},{"id":"4","value":["16"]},{"id":"5","value":"16MB"},{"id":"6","value":["6","11"]},

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: 8 years 10 months ago by Cz Vlask. Reason: x

Please Log in or Create an account to join the conversation.

More
8 years 10 months ago #143969 by Lefteris
Replied by Lefteris on topic K2 vs flashChart
Hi,

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.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum