
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Creating a visualization with custom data
Hi everyone
I'm trying to use the visualization API to create a chart on the fly, as described here:
However, I don't want to use dimensions/measures already in the model for this, I would like to supply my own data directly via javascript.
First of all, is this even possible? And if so, how?
I've tried something like this:
app.visualization.create(
'barchart',
[
"=ValueList('a', 'b', 'c')", //this dimension definition works
"???" //but how do I define the measure?? Is it possible?
],
{
"showTitles": true
}
)
.then((vis) => {
vis.show("graphContainer");
});
Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, but what I actually wanted to do is pass in the values, not a function.
I managed to do this by using a measure definition like this:
=Pick(RowNo(), "1, 2, 3, ...")

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Her it what you can do
app.visualization.create( 'barchart', [ "=ValueList('a', 'b', 'c')","=sum(2)"], { "showTitles": true } ) .then((vis) => { vis.show("graphContainer"); });
regards,
Ajay Kakkar

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks, but what I actually wanted to do is pass in the values, not a function.
I managed to do this by using a measure definition like this:
=Pick(RowNo(), "1, 2, 3, ...")
