hello, Im using PocketQuery macro in confluence and I don't know how to set up some kind of controller/filter as described here https://developers.google.com/chart/interactive/docs/gallery/controls
can you please give me an example how to set it up? what code write into pocketquery template and what in confluence page?
thanks in advance!
michal
Hi Michal,
Thank you for your interest in PocketQuery. In the Google Chart docs, there is a link to a jsfiddle:
screen-gcharts.png
Could you prepare your demo scenario with the GC API without PocketQuery? I will then have a look on how this can be integrated in a PQ template.
Regards, Felix
Hello Felix,
here is my example https://jsfiddle.net/nsma8h55/1/
I figured it out somehow in jsfiddle, I had to use controlType "CategoryFilter" because for NumberRangeFilter the column has to be number (in my case it is string in format 2015.00.00). So this kind of behavior would be fine for me.
And is there possibility to show eg. last 3 rows by default and then change it within that filter?
Thanks for your help!
Michal
Hi Michal! In view mode of the page with the PocketQuery macro, could you open a dev console in your browser and run PocketQuery.chartJson("yourQueryName") ? I'd like to examine your result and if it's compatible for the Google Chart API.
hi, here is the result: "{"cols":[{"id":"releaseID","label":"releaseID","type":"string"},{"id":"US","label":"US","type":"number"},{"id":"CA","label":"CA","type":"number"},{"id":"GB","label":"GB","type":"number"},{"id":"IE","label":"IE","type":"number"},{"id":"ES","label":"ES","type":"number"},{"id":"WW","label":"WW","type":"number"},{"id":"AVERAGE","label":"AVERAGE","type":"number"}],"rows":[{"c":[{"v":"2015.08.00"},{"v":2178.66},{"v":2308.80},{"v":2218.10},{"v":2422.66},{"v":2158.50},{"v":2145.70},{"v":2238.736666}]},{"c":[{"v":"2015.08.00"},{"v":2274.08},{"v":2128.56},{"v":2351.60},{"v":2251.68},{"v":2383.40},{"v":2221.26},{"v":2268.430000}]},{"c":[{"v":"2015.08.00"},{"v":2567.52},{"v":2631.80},{"v":2603.50},{"v":2696.34},{"v":2745.50},{"v":2820.26},{"v":2677.486666}]},{"c":[{"v":"2015.08.00"},{"v":4071.15},{"v":4060.05},{"v":3727.35},{"v":4735.25},{"v":4303.90},{"v":3851.88},{"v":4124.930000}]},{"c":[{"v":"2015.09.00"},{"v":3830.82},{"v":3706.35},{"v":3652.75},{"v":5080.93},{"v":4087.80},{"v":3937.18},{"v":4049.305000}]},{"c":[{"v":"2015.09.00"},{"v":3910.88},{"v":3962.05},{"v":3711.25},{"v":4536.48},{"v":4058.00},{"v":4031.90},{"v":4035.093333}]},{"c":[{"v":"2015.09.00"},{"v":3963.90},{"v":3584.43},{"v":3569.32},{"v":4853.68},{"v":3871.12},{"v":4147.85},{"v":3998.383333}]},{"c":[{"v":"2015.09.00"},{"v":4089.43},{"v":3465.20},{"v":3522.60},{"v":3959.50},{"v":3938.40},{"v":3701.22},{"v":3779.391666}]},{"c":[{"v":"2015.10.00"},{"v":2660.62},{"v":2580.70},{"v":2707.50},{"v":3135.85},{"v":2602.75},{"v":2536.32},{"v":2703.956666}]},{"c":[{"v":"2015.10.00"},{"v":3519.72},{"v":4166.82},{"v":4014.85},{"v":6525.50},{"v":4010.55},{"v":3718.50},{"v":4325.990000}]},{"c":[{"v":"2015.10.00"},{"v":3604.32},{"v":4142.70},{"v":4569.00},{"v":5960.62},{"v":3740.70},{"v":3388.50},{"v":4234.306666}]},{"c":[{"v":"2015.11.00"},{"v":5232.32},{"v":3381.38},{"v":3078.47},{"v":2521.22},{"v":4617.52},{"v":2163.78},{"v":3499.115000}]},{"c":[{"v":"2015.11.00"},{"v":5360.77},{"v":3491.38},{"v":2980.25},{"v":2143.97},{"v":4154.90},{"v":1926.62},{"v":3342.981666}]},{"c":[{"v":"2015.11.00"},{"v":5734.48},{"v":2750.75},{"v":3194.78},{"v":2254.10},{"v":4497.05},{"v":1994.85},{"v":3404.335000}]},{"c":[{"v":"2015.12.00"},{"v":2541.15},{"v":2548.43},{"v":2547.45},{"v":3511.50},{"v":2575.78},{"v":2499.12},{"v":2703.905000}]},{"c":[{"v":"2015.12.00"},{"v":3037.78},{"v":2740.15},{"v":2633.50},{"v":3826.10},{"v":2951.45},{"v":2571.30},{"v":2960.046666}]},{"c":[{"v":"2015.12.00"},{"v":3187.60},{"v":2785.03},{"v":2699.47},{"v":3926.05},{"v":2950.88},{"v":2768.68},{"v":3052.951666}]},{"c":[{"v":"2015.12.00"},{"v":3247.35},{"v":3003.10},{"v":2775.95},{"v":4205.65},{"v":2868.75},{"v":3136.65},{"v":3206.241666}]},{"c":[{"v":"2015.13.00"},{"v":2873.38},{"v":2741.25},{"v":2931.12},{"v":3901.62},{"v":2770.00},{"v":3116.29},{"v":3055.610000}]},{"c":[{"v":"2015.15.00"},{"v":2168.93},{"v":2330.55},{"v":2167.38},{"v":2073.75},{"v":2182.55},{"v":2078.95},{"v":2167.018333}]},{"c":[{"v":"2015.15.00"},{"v":2240.72},{"v":2393.68},{"v":2137.72},{"v":2112.90},{"v":2153.55},{"v":2258.57},{"v":2216.190000}]},{"c":[{"v":"2015.15.00"},{"v":2385.65},{"v":2617.38},{"v":2400.97},{"v":2273.10},{"v":2405.85},{"v":2434.68},{"v":2419.605000}]},{"c":[{"v":"default"},{"v":2318.57},{"v":2318.43},{"v":2144.00},{"v":2042.57},{"v":2202.67},{"v":2336.43},{"v":2227.111666}]},{"c":[{"v":"default"},{"v":2582.22},{"v":2289.50},{"v":2241.10},{"v":2278.20},{"v":2241.53},{"v":2585.45},{"v":2369.666666}]}]}"
Can you also paste the result for PocketQuery.queryArray("yourQueryName") ?
I reproduced your use case. This requires some further JS programming - your use case is not 100% covered by the PQ JavaScript API. I created some code for you (Gist) and also added some comments in it. I think this should be sufficient for you. Otherwise let me know!
It looks like you're new here. Sign in or register to get started.