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)
DataTimeDataSet data format?
markcheung
What should be the data format for DataTimeDataSet?
Can it be 12:00, 1:00, etc? or does it have to include the date?
or do I have to create my own custom dataset?
Find more posts tagged with
Comments
mwilliams
Hi markcheung,
Can you explain more about your issue, I'm not sure if I'm understanding correctly? Do you have a date coming in and you'd like to format it to just see the time? Or something else? Let me know. Thanks.
markcheung
This works, but not in the format that I would like it to be:
TextDataSet xcategory = TextDataSetImpl.create(data.getTimes());
to
and this doesn't:
DataTimeDataSet xcategory=DateTimeDataSetImpl.create(data.getTimes());
data.getTimes() returns a list of strings ("12:00", "2:00", "5:45", "6:07"....).
Thanks,
MC
mwilliams
MC,
I'm still not sure I'm understanding correctly. What kind of datasource are you using? How is your date coming in to your report dataSet? What are you trying to display? Is there any way you can create a similar report with the sample database or some other type of datasource that I can run so I can see what you're tying to do better?
markcheung
Actually, I am creating a timeline view plug-in with BIRT Charting Engine (not BIRT report?).
TextDataSet xcategory = TextDataSetImpl.create(data.getTimes());
DateTimeDataSet xcategory2=DateTimeDataSetImpl.create(data.getTimes());
// I would like to change this to DataTimeDataSet xcategory=DateTimeDataSetImpl.create(data.getTimes());
// and then bind it to the series
Series xseries = SeriesImpl.create();
xseries.setDataSet(xcategory);
SeriesDefinition xsdefinition = SeriesDefinitionImpl.create();
xAxis.getSeriesDefinitions().add(xsdefinition);
xsdefinition.getSeries().add(xseries);
xsdefinition.getSeriesPalette().shift(1);
Virgil Dodson
Hi Mark, The create() method of DateTimeDataSetImpl says it needs a Java Calendar object.<br />
<br />
I found an example that looked like this:<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
DateTimeDataSet dsDates = DateTimeDataSetImpl.create(new Calendar[] {
new CDateTime(2006, 7, 28, 10, 0, 0),
new CDateTime(2006, 7, 28, 10, 1, 0) });
</pre>
<br />
These links might also help<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/documentation/BIRT_220/ChartJavadoc/chart/api/org/eclipse/birt/chart/model/data/impl/DateTimeDataSetImpl.html'>DateTimeDataSetImpl
(BIRT Chart Engine API)</a><br />
<br />
<a class='bbc_url' href='
http://www.birt-exchange.org/documentation/BIRT_220/ChartJavadoc/chart/api/org/eclipse/birt/chart/util/CDateTime.html'>CDateTime
(BIRT Chart Engine API)</a>
markcheung
Ok, I think that works, but I would like it to have only the time part.
Is there a way to set the time scale (like by day or by hour)?
((ITimeScale)xAxis.getScale()).setStepTimeUnit(????)
--
Thanks
MC
markcheung
<a class='bbc_url' href='
http://dev.eclipse.org/newslists/news.eclipse.birt/msg12857.html'>link
: Time-scale x axis supported?</a> --><br />
<br />
Should I use a scattergram instead?
markcheung
I tried that (using scattergraph). For some reasons, when I import the package org.eclipse.birt.chart.script.api.scale, the view does not appear in the category (from show views-->others).
Can someone help?
--
Thanks,
MC