Quantcast
Channel: Pentaho Community Forums
Viewing all articles
Browse latest Browse all 16689

How to set the Pie chart color, based on the query result set?

$
0
0
Hi,

I want to create a Pie chart with cccv2. The datasource for this chart will deliver a table like this:

CATEGORY | VALUE
-------------------
OK | 1
ERROR | 4
OPEN | 3

The order and the names of the "CATEGORY" values are not fix (user defined value).
In the "Pre Execution" section I want to define a function to set the color values based on the "CATEGORY" name of the query result set.

So far I can define the colors:

Code:

function myColors() {

// ToDo: Read the input table and set the regarding color values
 pvc.setDefaultColorScheme(['green', 'red', 'blue']);
}

But I don't know how to get the names of the "CATEGORY".

I hope someone can help.
Thanks in advance...

Viewing all articles
Browse latest Browse all 16689

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>