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 9319569
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T03:25:03+00:00 2026-06-19T03:25:03+00:00

I have an XY chart where I want to represent X values along some

  • 0

I have an XY chart where I want to represent X values along some dates. The creation of the dataset is simple:

XYSeries serie = new XYSeries("valor");
for(int i=0;i<lista.size();i++){
    serie.add(i,lista.get(i).getValue());

}
dataset.addSeries(serie);

where serie.add uses as arguments (y.value, x.value). I am representing the x value along time, but it appears as just the index of the arraylist (obvious, I use i as the first parameter). My question is, how could I show dates (or Strings) as the Y values?
I know that this possible to be done with a BarChart, for instance:

DefaultCategoryDataset dataSet = new DefaultCategoryDataset();
        dataSet.addValue(51, "series", "Colonel Forbin");
        dataSet.addValue(92, "series", "The Lizards");

Something like this is what I need to do, hope you could help, thanks

  • 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-19T03:25:05+00:00Added an answer on June 19, 2026 at 3:25 am

    As shown here, if the range values in your series represent milliseconds from the Java epoch, a DateAxis should display the values correctly.

    NumberAxis domain = new NumberAxis("X");
    DateAxis range = new DateAxis("Y");
    domain.setAutoRangeIncludesZero(false);
    XYItemRenderer renderer = new XYLineAndShapeRenderer(true, false);
    XYPlot plot = new XYPlot(dataset, domain, range, renderer);
    JFreeChart chart = new JFreeChart(
        "Title", JFreeChart.DEFAULT_TITLE_FONT, plot, false);
    

    Addendum: I just want to set … tags that change dynamically.

    It looks like you want SymbolAxis, seen here.

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

Sidebar

Related Questions

I have a matplotlib code that generates a simple 2D chart. I want to
I am playing with matplotlib - I have a bar chart, and I want
I want to use bar chart in web application. I have searched many libraries
I have two issues in this google chart. I want to either get rid
I want to plot some values representing visible satellites into a polar graph with
I have a simple question that is confusing me. Goal : I want to
I want to represent some data visually, using a visualization component. Now I want
I have a chart with tooltip in it, what I exactly want to do
I want visually represent table row data in a chart/graph but the chart should
If I have a set of small string values, and I want to fetch

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.