I'm working on my first Canvas and want to show statistics about my payment brands in my shop, including a time filter and a payment brand filter:
Everything works as I want, except for the payment brands filter. After some fiddling, I did get to populate it correctly but when I select one of the payment brands, the chart is not filtered based on that brand (which is my goal) and throws an error (that is gone very quickly, so I had to record my actions to be able to see what it says
My code for the chart:
filters
| timelion
query=".es(index=wlsips-demo, timefield='@timestamp', metric='count:transaction_amount', split=payment_brand_name.keyword:10).label(\"$1\", \"^.*keyword:(\\S+).*\")" interval="1d"
| pointseries x="@timestamp" y="value" color="label"
| plot defaultStyle={seriesStyle fill="1" lines="3"}
palette={palette "#44697D" "#5E2D61" "#739ABC" "#72CE98" "#4B92DB" "#BF2296" "#949D9E" "#5E6A71" "#AF94A3" gradient=false} legend="nw"
font={font family="'Myriad Pro', 'Cambria', sans-serif" size=12 align="left" color="#000099" weight=600 underline=false italic=false}
| render
containerStyle={containerStyle backgroundColor="#FFFFFF" border="1px solid #BBBBBB" borderRadius="4px" padding="10px" opacity="1"}
My code for the dropdown
filters
| timelion
query=".es(index=wlsips-demo, timefield='@timestamp', metric='count:transaction_amount', split=payment_brand_name.keyword:10).label(\"$1\", \"^.*keyword:(\\S+).*\")" interval="1d"
| mapColumn "brands" fn={getCell "label"}
| columns include="brands"
| dropdownControl valueColumn="brands" filterColumn="brands"
| render
The error I'm getting:
Anyone any idea how to fix this?
Thanks
Jeroen