Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
categories on y-axis?
Ingo
Hi,
is it possible to have non numeric values on the y-axis? I want to display the occurrence of different items on a time line (x-axis).
For example:
Item; Time
A; 13:05
B; 13:06
A; 13:07
C: 13:09
On the y-axis should be each Item (A, B, C) and the x-axis should be time line.
But I cannot apply the column "Item" zu the y-series!? Only numeric values. As a workaround I added a column displaying numeric values for each item, but I need the item value to be displayed as y-axis labels.
Thanks,
ingo
Find more posts tagged with
Comments
mwilliams
Hi Ingo,
A way to get around the labeling issue is just to create the table with your workaround column and then rename the label with script. Below is a sample bit of script you can use to change your label values from '1', '2', and '3' to a 'A', 'B', and 'C' and remove all other values. This scripting is done in the OnRender script section of the chart using the beforeDrawAxisLabel function.
if (label.getCaption().getValue() == "1")
{
label.getCaption().setValue("A");
axis.setLabel(label);
}else if (label.getCaption().getValue() == "2")
{
label.getCaption().setValue("B");
axis.setLabel(label);
}else if (label.getCaption().getValue() == "3")
{
label.getCaption().setValue("C");
axis.setLabel(label);
}else
{
label.getCaption().setValue("");
axis.setLabel(label);
}
Regards,
Michael
mwilliams
Ingo,
Sorry, that replaces the time values on the x axis with "" as well because of the else statement. The else should have been:
else if (label.getCaption().getValue() == "0")
{
label.getCaption().setValue("");
axis.setLabel(label);
}
Regards,
Michael
Ingo
Thanks,
as you've might already seen, I also tried this approach. But since I need a bit more dynamic approach, I tried to fill an array with the corresponding exchange values. I filled this array during the onFetch of the DS, but that way I wasn't able to set the data to chart. (see Thread: 'Register vars in onFetch'). Is it possible to change the value to another value of the underlying ds?
Thanks,
Ingo
mwilliams
Ingo,<br />
<br />
I found a more dynamic solution to this problem. Probably very similar to what you were working on, getting the persistentGlobalVariables set up in the onFetch of the dataSet. In 2.2.2, this caused a problem with accessing the data. A BIRT exception occured with the only available at runtime explanation. In 2.3, the data still can't be seen in the chart builder, but the column headers are there. Also, I noticed that if you set up the chart before creating the persistentGlobalVariables, the preview of the chart worked just fine, even though you can't see the data in the chart builder......in both 2.2 and 2.3. Another way to pass the variables to the chart would be to set up persistent Global variables in a hidden table. Also, you could use the interactivity features of the chart to pass in data from the dataSet.<br />
<br />
I logged a bug for the BIRT exception problem here:<br />
<br />
<a class='bbc_url' href='
https://bugs.eclipse.org/bugs/show_bug.cgi?id=237650'>https://bugs.eclipse.org/bugs/show_bug.cgi?id=237650</a><br
/>
<br />
Regards,<br />
<br />
Michael
Ingo
Thanks,
yeah I did it the same way...with the result of your submitted bug. But because I do not change the initial setup of the chart, the chart-builder bug does not bother me that much. ;-)
But I'm also interested in the workarounds you suggested.
1. The hidden table: That would cause a performance loss right?
2. How can I use the interactivity feature for passing in data? Do you have an example?
Thanks,
Ingo
mwilliams
Ingo,<br />
<br />
Yeah, with the hidden table, you'll have some extra processing. How much will depend on how much data you have.<br />
<br />
For the passing of data through the interactivity, you can see how that is done in the following example from the devShare. I don't know if it'll be helpful for this application, but in future applications you have, this may come in handy. The scripting/data passing is done in the table, the chart, and the interactivity on the chart under key up/down/press.<br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.com/modules/wfdownloads/singlefile.php?cid=2&lid=276'>http://www.birt-exchange.com/modules/wfdownloads/singlefile.php?cid=2&lid=276</a><br
/>
<br />
The current way of setting PGV's in the dataSet is probably the most efficient way if you can deal with the runtime exception, which doesn't seem to cause any real problems.<br />
<br />
Regards,<br />
<br />
Michael