$Chart

  • 3
  • Question
  • Updated 2 years ago
  • Answered
Can anyone give a quick rundown of the parameters available within the {{$Chart}} merge syntax?

Thanks!
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb

Posted 3 years ago

  • 3
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
I found {{$Chart.point.name}} in this tutorial, and have found it quite handy for drilldowns... but I'm sure there's so much more!
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,714 Points 20k badge 2x thumb
Agreed. This would make for better labeling.
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
This is something we'd like to get documented, but the usual caveat of "until we actually document it, it's a 'use at your own risk' situation" definitely still applies. $Chart.point is a reference to the Highcharts Point Object for the "point" you clicked on. Not everything that comes through is documented by Highcharts though, so especially take care if you are trying to use something that Highcharts doesn't even document. In any case, here are some of the ones that I think might be useful (links to Highcharts documentation where it exists):
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
Woot Woooot!!!
Thank you!!!
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Sure thing! This does allow for some nice touches with "smartly" updating Title/Subtitles on your charts, or setting conditions on separate models. Those are the two big use cases we've seen thus far, but as always, we're excited to see what you all come up with.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Can I use this for actions other than a chart drilldown?

I set a series to open a popup on click (which works great!) but the {{$Chart}} syntax used in the popup (in the title or elsewhere) isn't returning anything.
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Anyone have an answer for this?
Photo of J.

J., Official Rep

  • 7,470 Points 5k badge 2x thumb
Which version are you running? I seem to recall that we rolled that out in Rockaway. Here's some Page XML that seems to be working for me:
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Opportunity">    <models>        <model id="Opportunity" limit="100" query="true" createrowifnonefound="false" datasource="salesforce" sobject="Opportunity" type="">            <fields>                <field id="Name"/>                <field id="CreatedDate"/>                <field id="Amount"/>                <field id="StageName"/>            </fields>            <conditions/>            <actions/>        </model>    </models>    <components>        <skuidvis__chart model="Opportunity" maintitle="{{Model.labelPlural}}" type="pie" uniqueid="sk-3Ks2QW-108">            <dataaxes>                <axis id="axis1"/>            </dataaxes>            <categoryaxes>                <axis id="categories" categorytype="field"/>            </categoryaxes>            <serieslist>                <series valuefield="Amount" splittype="template" aggfunction="sum" splittemplate="{{StageName}}">                    <actions>                        <action type="showPopup">                            <conditions>                                <condition type="contextrows" field="Id" mergefield="Id" operator="in" autocreated="true"/>                            </conditions>                            <popup title="New Popup" width="90%">                                <components>                                    <pagetitle model="Opportunity" uniqueid="sk-3KsB_n-133">                                        <maintitle>Chart Point: {{$Chart.point.name}}</maintitle>                                        <subtitle>{{Model.labelPlural}}</subtitle>                                        <actions/>                                        <conditions>                                            <condition type="contextrow" field="Id" mergefield="Id"/>                                        </conditions>                                    </pagetitle>                                    <skootable showconditions="true" showsavecancel="true" showerrorsinline="true" searchmethod="server" searchbox="true" showexportbuttons="false" pagesize="10" createrecords="true" model="Opportunity" buttonposition="" mode="read" allowcolumnreordering="true" uniqueid="sk-3KsNEn-142">                                        <fields>                                            <field id="Name" hideable="true" uniqueid="fi-3KsP_h-155"/>                                            <field id="StageName" hideable="true" uniqueid="fi-3KsP_i-156"/>                                            <field id="CreatedDate" hideable="true" uniqueid="fi-3KsP_j-157"/>                                            <field id="Amount" hideable="true" uniqueid="fi-3KsP_j-158"/>                                        </fields>                                        <rowactions>                                            <action type="edit"/>                                            <action type="delete"/>                                        </rowactions>                                        <massactions usefirstitemasdefault="true">                                            <action type="massupdate"/>                                            <action type="massdelete"/>                                        </massactions>                                        <views>                                            <view type="standard"/>                                        </views>                                        <conditions>                                            <condition type="contextrows" field="Id" mergefield="Id" operator="in"/>                                        </conditions>                                    </skootable>                                </components>                            </popup>                        </action>                    </actions>                </series>            </serieslist>            <colors/>            <legend layout="horizontal" halign="center" valign="bottom"/>        </skuidvis__chart>    </components>    <resources>        <labels/>        <css/>        <javascript/>    </resources>    <styles/>    <pageregioncontents/></skuidpage>
(Edited)
Photo of Matt Sones

Matt Sones, Champion

  • 31,478 Points 20k badge 2x thumb
Ha. Well, I haven't actually tried it again, since there wasn't a response...
Thanks for the fix!
Photo of Cody Taylor

Cody Taylor, Documentation

  • 474 Points 250 badge 2x thumb
Good news everyone!
We've added information about the $Chart merge variables in our documentation: 

http://help.skuid.com/m/components/l/293051-visualizations-charts-and-graphs#$ChartMergeVariables

As J. stated, we were hesitant about explicitly listing these variables as they are based on an external API. We're listing them now with the disclaimer that, should Highcharts deprecate these APIs, Skuid cannot support any broken merge variables. I think it's safe to say that would be an unlikely event, but it's wise to keep in mind.