Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[birt-charting-dev] Supporting timestamp


I was looking at the APIs.  From what I gather you can add blocks to the model.  These block can be added the chart "block".  Therefore to render a timestamp I add the following to the chart model:


    ChartWithAxes cwaBar = ChartWithAxesImpl.create();

//Create timestamp label block
    LabelBlock timestamp = (LabelBlock)LabelBlockImpl.create();
    Label label = LabelImpl.create();
    Text text = TextImpl.create(SimpleDateFormat.getInstance().format(Calendar.getInstance().getTime()));
    label.setCaption(text);
    timestamp.setLabel(label);

//Add timestamp to the chart model
    cwaBar.getBlock().getChildren().add(timestamp);


I was able to see the timestamp however, the timestamp is displayed in the top right corner.  Is there a way to layout the timestamp.  Are there any layout classes?

In terms of supporting timestamp features such as date formatting I guess I could extend the LabelBlockImpl class to add specific timestamp attributes for our needs.

Thanks,

Sheldon
______________________________________
Sheldon Lee-Loy
Problem Deterministic Group, IBM Toronto Lab
email: sleeloy@xxxxxxxxxx
phone: 905.413.2610

Back to the top