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)
Why display each date in X-Axis 2 times?
Allen2009
Hi,
I create a chart and display Date in X-Axis,
Here is x-Axis:
Axis xAxisPrimary = cwaLine.getPrimaryBaseAxes()[0];
xAxisPrimary.setType(AxisType.DATE_TIME_LITERAL);
xAxisPrimary.getMajorGrid().setTickStyle(TickStyle.BELOW_LITERAL);
xAxisPrimary.getOrigin().setType(IntersectionType.MIN_LITERAL);
xAxisPrimary.getTitle().getCaption().setValue("Datum");
xAxisPrimary.getLabel().getCaption().getFont().setRotation(45);
xAxisPrimary.getTitle().setVisible(true);
xAxisPrimary.setFormatSpecifier(JavaDateFormatSpecifierImpl.create("dd/MM"));
xAxisPrimary.getMajorGrid().getLineAttributes().setVisible(true);
xAxisPrimary.getMajorGrid().getLineAttributes().setColor(ColorDefinitionImpl.WHITE());
I also tried xAxisPrimary.getScale().setUnit(ScaleUnitType.DAYS_LITERAL);
but it didnt change anything.
Anybody got an idea ?
Liang
Find more posts tagged with
Comments
Allen2009
I got it,
add this one:
xAxisPrimary.getScale().setStep(1);
it means interval One Day.
Davolio
You need to make sure your x-axis is your category axis. If you do then BIRT will average the two points together, OTHERWISE you need to make your labels more specific so that each has a different label i.e. instead of 12/12/2009 have 12/12/2009 12:12:01.
Hope that helps,
Dave
Allen2009
hi Dave,
thanks for your reply !!
At First I set "xAxisPrimary.setCategoryAxis(false);"
then I got picture 1.
each Label on x-Axis has Gridline
if I set "xAxisPrimary.setCategoryAxis(true);
then I got picture 2, like you said. BIRT average 4 points
both work fine if I set :
xAxisPrimary.getScale().setUnit(ScaleUnitType.DAYS_LITERAL);
xAxisPrimary.getScale().setStep(1);
I set AxisType is DateTime, so I think 19/12 and 20/12 are different.
thanks again for you help!!
Liang