Time series chart skipping few plots

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
nandan_mp
Posts: 2
Joined: Mon Mar 13, 2017 9:30 am
antibot: No, of course not.

Time series chart skipping few plots

Post by nandan_mp » Mon Mar 13, 2017 9:37 am

Hi,
I am creating a timeseries chart for last 30 days with values. I need to filter out weekends in the chart. The data am reading from DB doesnt have data for weekends but still I get a straight line from Friday to Monday. I dont want this line in the chart instead it should only plot for the data available. I used CategoryDataSet also but it is also not working. Please reply.

TimeSeries popAvg = new TimeSeries("Avg Price" + titlePrefix);
popAvg.add(new Millisecond((Date) metalPrice.get("TIME")), (BigDecimal) metalPrice.get("AVG_PRICE"));
TimeSeriesCollection dataset = new TimeSeriesCollection();
dataset.addSeries(popAvg);
JFreeChart chart = ChartFactory.createTimeSeriesChart(currencyPair, "Hour:Minute", "Avg price of Bid & Offer ($)", dataset, true, true, false);

Any help would be highly appreciated.

John Matthews
Posts: 513
Joined: Wed Sep 12, 2007 3:18 pm

Re: Time series chart skipping few plots

Post by John Matthews » Mon Mar 13, 2017 11:11 am

You may be looking for a SegmentedTimeline, suggested here.

nandan_mp
Posts: 2
Joined: Mon Mar 13, 2017 9:30 am
antibot: No, of course not.

Re: Time series chart skipping few plots

Post by nandan_mp » Tue Mar 14, 2017 7:07 am

Seems like I have got rid of straight line. Great. Than you so much,

Locked