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)
Label question
markcheung
Hi,
I would like to set the xAxis's label so that it shows a range of time rather than just its datavalue (CDateTime format).
xAxis.getLabel().setCaption(????);
I need to access the CDateTime value in the label and have the label shows also an interval of time (possibly 1 hour) before the value. (I can get the previous time with CDateTime pv=value.backward(12, interval); )
So I need to know how to access the CDateTime value from the label and modify the label's caption.
Find more posts tagged with
Comments
mwilliams
Hi MC,
You should be able to grab the current label value with the following script function and code:
function beforeDrawAxisLabel( axis, label, icsc )
{
label.getCaption().getValue();
}
Let me know if I'm not understanding your question correctly.
markcheung
I don't think that works. I am using BIRT Chart Engine to create a histogram view rather than a report. The only way to do so using BIRT is by starting with a bargraph and making it look like a histogram. The label that I am getting is a set of x-axis scales (in CDateTime format), so it is something like 07/ 28 05:00, 7/28 10:00, 7/28 15:00, 7/28 20:00. I have already gotten the frequencies for the time range, and I would like to make it look like a histogram rather than a bar graph. I can either set the scales' label to a set of ranges (07/ 28 00:00 <strong class='bbc'>-</strong> 07/ 28 05:00, 07/ 28 05:00 <strong class='bbc'>-</strong> 7/28 10:00, etc) or insert a beginning scale label with no value and shift all the bars to the left.<br />
<br />
Code snippet:<br />
<br />
xAxis = chart.getPrimaryBaseAxes()[0];<br />
xAxis.getLabel().getCaption().getFont().setRotation(45);<br />
// xAxis.setLabelPosition(Position.RIGHT_LITERAL); //error<br />
xAxis.setGapWidth(10); //??<br />
xAxis.getTitle().getCaption().setValue("Time");<br />
xAxis.getTitle().getCaption().setColor(ColorDefinitionImpl.CREAM());<br />
xAxis.getTitle().setVisible(true); <br />
String k=xAxis.getLabel().getCaption().getValue();<br />
System.out.println("Value: "+k); -->print out "Value: " no k value?
markcheung
Here's a screenshot (attached).