Skip to content

Instantly share code, notes, and snippets.

@erikwett
Last active March 10, 2016 10:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikwett/1a822a065e18e90831de to your computer and use it in GitHub Desktop.
Save erikwett/1a822a065e18e90831de to your computer and use it in GitHub Desktop.
Create a chart and specify labels with Visualization API
app.visualization.create( 'pivot-table',
[
"Year", //dimension
{"qDef" : { "qFieldDefs" : ["Case Owner Group"], "qFieldLabels" : ["Group"] }}, //dimension with label
{"qDef" : { "qDef" : "=Avg([Case Duration Time])", "qLabel" : "Avg Case Duration Time" }},//measure with label
{"qDef" : { "qDef" : "Sum( [Open Cases] )", "qLabel" : "Open Cases" }} //measure with label
],
{"title" : "Case Owner Group Case stats per year"}
).then( function ( visual ) {
visual.show( 'QV01' );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment