Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7828307
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T10:18:12+00:00 2026-06-02T10:18:12+00:00

I have a TimeSeries chart, showing up some values per dates and there are

  • 0

I have a TimeSeries chart, showing up some values per dates and there are two series which displays as two different lines.
The problem is that sometimes one series does not contain values for some particular dates. In that case I assume that line will be continued from previous point to next on this series.
Unfortunately it does not work correctly on chart, it looks like something wasn’t drawn correctly at all.

If every series contains appropriate values per every date then it’s fine.

My code is here:

for (String source : graphData.keySet()) {
        SortedMap<LocalDate, BigDecimal> data = graphData.get(source);
        LocalDate prevDate = null;
        for (LocalDate date: data.keySet()) {
            if (prevDate == null) {
                prevDate = date;
                continue;
            }
            dataset.add(new SimpleTimePeriod(prevDate.toDateMidnight().toDate(), date.toDateMidnight().toDate()), data.get(prevDate), source, true);
            prevDate = date;
        }
        dataset.add(new SimpleTimePeriod(prevDate.toDateMidnight().toDate(), futureDate), data.get(prevDate), source, true);
    }

Map<String, SortedMap<LocalDate, BigDecimal>> graphData contains the data for all series, where key of the map is the series name.
And as I said – sometimes series A contains values for dates 1, 2 and 3, and series B only for 1 and 2. In that case line for A and B does not look properly…

Is there any easy way to fix that?
The obvious and hard-to-implement way is to calculate the missed value for B series (using linear interpolation?) and put it to dataset, but it would be really very hard to do. Maybe I missed something?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T10:18:18+00:00Added an answer on June 2, 2026 at 10:18 am

    Found out how to solve it –
    For every series create it’s own dataset and renderer.
    Then, when creating a chart use any one dataset, and afterthat add all those datasets and renderers.

    xyPlot.addDataset(0, firstDataset);
    xyPlot.addDataset(1, secondDataset);
    

    Or if there are can be a plenty series then it’s better to do it in the cycle

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a time series of two indexes, with each row representing the closing
I have an xts time series of weekly values Jan 4 2004, 0.99 Jan
let's say, I have this xml file: <?xml version=1.0 encoding=UTF-8 ?> <TimeSeries> <timeZone>1.0</timeZone> <series>
I want to create a massive TimeSeries object which will hold 1000 different financial
I have the following data which is a timeseries of data points (see dput()
I have imported a time series with dates of the following format: test =
I am using R for some statistical analysis of time series. I have tried
I have a chart created as shown below, and I am adding values to
I have a count time series data which I'm able to use to determine
I have timeseries data for many terms an example of which is below: term1

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.