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

  • Home
  • SEARCH
  • 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 4044318
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T13:14:20+00:00 2026-05-20T13:14:20+00:00

I am using Jfree chart 0.9.20’s XYLineChartDemo for plotting the execution time of running

  • 0

I am using Jfree chart 0.9.20’s XYLineChartDemo for plotting the execution time of running processes in a program. My X axis denotes the time and Y axis should denote the Pid. How can I edit the Jfreechart files to make my Y axis to denote values I want and not numbers 0-range?? Also is there a way to make the line plotted to be made thicker in width?

  • 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-05-20T13:14:20+00:00Added an answer on May 20, 2026 at 1:14 pm

    study this:

    public JFreeChart createChart(String axisX, String axisY){
    
        JFreeChart chart = ChartFactory.createTimeSeriesChart(null, axisX, axisY, dataSeries, true, true, false);
    
        final XYLineAndShapeRenderer renderer = new XYLineAndShapeRenderer();
        renderer.setSeriesLinesVisible(0,true);
        renderer.setSeriesShapesVisible(0, true);
    
        //percentage (y-axis)
        final NumberAxis percentAxis = new NumberAxis(axisY);
        percentAxis.setInverted(false);
        percentAxis.setRange(0.0, 100.0);
    
        //time (x-axis)
        final DateAxis timeAxis = new DateAxis(axisX);
        timeAxis.setStandardTickUnits(DateAxis.createStandardDateTickUnits(TimeZone.getDefault(), Locale.ENGLISH));
    
        double range = 0;
    
        switch (format){
            case ONE_MINUTE_RANGE: range = 60*1000; break;
            case TEN_MINUTE_RANGE: range = 10*60*1000; break;
            case ONE_HOUR_RANGE: range = 60*60*1000; break;
        }
    
        timeAxis.setRange(System.currentTimeMillis()-range/2, System.currentTimeMillis()+range/2); //time duration based on format chosen
    
        XYPlot plot = chart.getXYPlot();
        plot.setDomainAxis(timeAxis);
        plot.setRangeAxis(percentAxis);
    
        plot.setBackgroundPaint(Color.white);
        plot.setRangeGridlinePaint(Color.gray);
        plot.setRangeZeroBaselinePaint(Color.gray);
        plot.setDomainGridlinePaint(Color.gray);
        plot.setForegroundAlpha(0.5f);
        plot.setRenderer(renderer);
    
        chart.setBackgroundPaint(Color.white);
    
        return chart;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using jfree chart to graphically represent data in a time line basis.
I'm making (time series) moutain chart using JFreeChart. So, i made 2 timeseries -
I am trying to create a using jfree chart library line chart and i
I'm using JFreeChart to create a Time Series Chart but while I'm passing Integer
I am using jfree chart for graphically displaying metrics.Now I am working on a
I am using Jfreechart to create a chart. I am displaying this on a
Right now I'm using JFreeChart in order to create a dynamic chart. However the
I'm using JFreeChart to create a chart that has 6 TimeSeries in it. Problem
I'm using SpringSource Tool Suite (Eclipse) to program with Grails, and I'm also using
import java.awt.Color; import java.awt.Dimension; import javax.swing.JPanel; import javax.swing.Timer; import org.jfree.chart.ChartFactory; import org.jfree.chart.ChartMouseEvent; import org.jfree.chart.ChartMouseListener;

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.