JdbcXYDataset « Dataset « JFreeChart Q&A





1. JDBCXYDataset fetch Timestampvalue    jfree.org

Hi, I have tested JfreeChart with an Oracle database and had problems using a "DATE" column. The values were truncated. I have found a post at http://www.objectstyle.org/cayenne/list ... /0003.html were the same problem occurs in another environment. I have changed the code in JDBCXYDataset/executeQuery to use getTimestamp instead of getObject. It now looks like this: ------------------------------ ... while (resultSet.next()) { ArrayList ...

2. create chart with JDBCXYDataSet help    jfree.org

Hi all. I've successfully created a JDBCXYDataSet using a sql query to a SQL Server database. Problem is, I don't know how to create a chart with this data set. I tried using the createLineChart method of the ChartFactory package, but it apparently will not take a JDBCXYDataSet object as it's dataset parameter. Anyone know what I need to do? By ...

3. Problem using JDBCXYDataset in premium demos    jfree.org

hello i am trying to make a panel that shows a chart that gets its data from an database and beneth i put a button which should have the function to exectute another query and then show it on the chart. So i tried the JDBCXYDataset demo from premium demos ... the only problem is that it showes static data. And ...

4. May be It's Bug with JDBCXYDataset?    jfree.org

Hi all! I have trouble with JDBCXYDataset.. I m work with jdk 1.4.2 and Oracle example table: create table b1{ date1 DATE, a1 NUMBER } When i'm try to execute query like this: query = "select trunc(date1, 'HH24') , a1 from b1"; jdbcXYDataset.executeQuery(query); the chart look something wrong - times values truncated to date anyway.. When i change interval - 'DD' ...

5. problem w/ JDBCXYDataset    jfree.org

Hello, I'm having a problem w/ JDBCXYDataset and Oracle 10g that I hope someone can help me with. Given a table: Name Null? Type ----------------------------------------- -------- ---------------------------- OBSERV_DATE TIMESTAMP(6) PRESSURE NUMBER(10,5) TEMPERATURE NUMBER(10,5) I'm calling JDBCXYDataset#executeQuery and throwing the following exception: java.lang.ClassCastException: oracle.sql.TIMESTAMP at org.jfree.data.jdbc.JDBCXYDataset.executeQuery(JDBCXYDataset.java:346) at org.jfree.data.jdbc.JDBCXYDataset.executeQuery(JDBCXYDataset.java:213) at gov.noaa.gdsg.BprGraph.getData(BprGraph.java:110) at gov.noaa.gdsg.BprGraph.generateXYChart(BprGraph.java:47) at gov.noaa.gdsg.BprGraph.main(BprGraph.java:159) Exception in thread "main" java.lang.IllegalStateException: Error retrieving data ...

6. Types.BIT in JDBCXYDataset    jfree.org

7. JDBCXYDataset question    jfree.org

Hi, I am trying to use the JDBCXYDataset to generate a time series chart. However I am not sure what kind of data should the sql statement return. sql = "SELECT datetime, value FROM table"; What is the format of datetime? Does it need to be a specific data type? How do I specify whether the chart should plot daily, weekly ...

8. How to getSeries in a JDBCXYDataset?    jfree.org

JDBCXYDataset uses its own internal storage format, so you can't just fetch a TimeSeries from it. If you really need the data in that format, you could create a new TimeSeries instance, and populate it by calling the dataset methods (getItemCount(), getXValue(), getYValue() etc.) that are defined by JDBCXYDataset. Alternatively, you could by-pass the JDBCXYDataset altogether, and write your own JDBC ...





10. JDBCXYDataset    jfree.org

Hello , I hope that someone can help me!!!! Im working whith postgres sql. I have the Tables like this. I have a colum where is defined from whitch serie is the value. * X | SERIESNR | VALUE | -----------+---------------+----------+---- * 1-Aug-2002 | 1 | 32.1 | * 2-Aug-2002 | 2 | 54.3 | * 3-Aug-2002 | 3 | 55.9 ...

11. getItemCount() call on a JDBCXYDataset    jfree.org

Hello, I am finding that if I call getItemCount() on a JDBCXYDataset that contains ZERO records... that getItemCount() is returning the integer ONE (and not zero). Here's the code snippet: JDBCXYDataset QIdataALL; QIdataALL = new JDBCXYDataset(Database.conn); String sql = "SELECT obstime, value FROM discharge WHERE (lid = 'ABEM6' AND pe = 'QI' AND value > -9998) ORDER BY obstime DESC" QIdataALL.executeQuery(sql); ...

12. [JDBCXYDataset] Create a SQL view    jfree.org

Hi! I've tried to execute this: Code: Select all s.executeQuery("create view [V_NumLibriPU] as " + "select id, count(titolo) as NumLibri " + "from libri,utenti " ...

13. JDBCXYDataSet and Moving Average    jfree.org

JDBCXYDataset dataset1 = createDataset1(); JFreeChart chart = ChartFactory.createTimeSeriesChart(title,"Date","Enquirers",dataset1, true, true, false); XYPlot plot = (XYPlot) chart.getPlot(); plot.setDomainPannable(true); plot.setRangePannable(true); NumberAxis axis2 = new NumberAxis("Students"); axis2.setLabelFont(plot.getDomainAxis().getLabelFont()); axis2.setAutoRangeIncludesZero(true); plot.setRangeAxis(1, axis2); plot.setDataset(1, createDataset2()); plot.mapDatasetToRangeAxis(1, 1); XYItemRenderer renderer0 = plot.getRenderer(); renderer0.setBaseToolTipGenerator(StandardXYToolTipGenerator.getTimeSeriesInstance()); if (renderer0 instanceof XYLineAndShapeRenderer) { XYLineAndShapeRenderer rr = (XYLineAndShapeRenderer) renderer0; rr.setSeriesPaint(1, new Color(200, 100, 100)); rr.setBaseShapesVisible(false); ...

14. JDBCXYDataset - Not enough valid columns    jfree.org

I am trying to create a line chart based on a database query. Fairly simple example, my sql defo return two columns so I cannot see why I ge this error message. I even tried with dummy values, selecting from dual and still no joy. PLease please help, this should work! XYDataset lineDataset = new JDBCXYDataset(dbConnection); ((JDBCXYDataset)lineDataset).executeQuery(QUERY); java.sql.SQLException: Not enough valid ...

15. JDBCXYDataset with PreparedStatement - pls check that code    jfree.org

www.jfree.org View topic - JDBCXYDataset with PreparedStatement - pls check that code www.jfree.org Free Java software for data analysis and presentation Skip to content Advanced search Board index JFreeChart JFreeChart - General Change font size FAQ Register Login JDBCXYDataset with PreparedStatement - pls check that code A free public discussion forum for the JFreeChart class library. Post a ...





17. about JDBCXYDataset,why is there no chart displayed?    jfree.org

public static void main(String[] args) throws Exception{ JDBCXYDataset dataset = getDataSet2(); JFreeChart chart = ChartFactory.createTimeSeriesChart( "chart", "type", "volume", dataset, true,true, false); FileOutputStream fos_jpg = null; try { fos_jpg = new FileOutputStream("stockRealChart2.jpg"); ChartUtilities.writeChartAsJPEG(fos_jpg,100,chart,400,300,null); } finally { try { fos_jpg.close(); } catch (Exception e) {} } } private static JDBCXYDataset getDataSet2()throws Exception{ JDBCXYDataset dataset=new JDBCXYDataset(StockDataAdapter.getConnectionPools().getConnection()); try{ dataset.executeQuery("select logdate,price from stockData where stockcode='ptr' order ...