jfreechart | 2D chart library for Java applications

 by   jfree Java Version: 1.5.3 License: LGPL-2.1

kandi X-RAY | jfreechart Summary

kandi X-RAY | jfreechart Summary

jfreechart is a Java library typically used in User Interface, JavaFX applications. jfreechart has no bugs, it has no vulnerabilities, it has build file available, it has a Weak Copyleft License and it has high support. You can download it from GitHub, Maven.

JFreeChart is a comprehensive free chart library for the Java(tm) platform that can be used on the client-side (JavaFX and Swing) or the server side (with export to multiple formats including SVG, PNG and PDF).
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              jfreechart has a highly active ecosystem.
              It has 1045 star(s) with 408 fork(s). There are 55 watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 92 open issues and 102 have been closed. On average issues are closed in 134 days. There are 31 open pull requests and 0 closed requests.
              It has a positive sentiment in the developer community.
              The latest version of jfreechart is 1.5.3

            kandi-Quality Quality

              jfreechart has 0 bugs and 0 code smells.

            kandi-Security Security

              jfreechart has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              jfreechart code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              jfreechart is licensed under the LGPL-2.1 License. This license is Weak Copyleft.
              Weak Copyleft licenses have some restrictions, but you can use them in commercial projects.

            kandi-Reuse Reuse

              jfreechart releases are available to install and integrate.
              Deployable package is available in Maven.
              Build file is available. You can build the component from source.
              Installation instructions are not available. Examples and code snippets are available.
              jfreechart saves you 129510 person hours of effort in developing the same functionality from scratch.
              It has 137382 lines of code, 11303 functions and 1061 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed jfreechart and discovered the below as its top functions. This is intended to give you an instant insight into jfreechart implemented functionality, and help decide if they suit your requirements.
            • Draw an item pass over the plot .
            • Draws a vertical panel item .
            • Creates the popup menu .
            • Finds the previous standard date for the given date .
            • Draw a domain marker
            • Refresh the vertical tick labels .
            • Creates the plot panel .
            • Draw tasks for a Category item .
            • draw axis labels
            • Draws a single item .
            Get all kandi verified functions for this library.

            jfreechart Key Features

            No Key Features are available at this moment for jfreechart.

            jfreechart Examples and Code Snippets

            How to combine two polar charts?
            Javadot img1Lines of Code : 137dot img1License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            public Action getZoomInAction() {
                return new AbstractAction("Zoom In") {
                    @Override
                    public void actionPerformed(ActionEvent e) {
                        rangeAxis.setLowerBound(-rangeAxis.getUpperBound() / 2);
                    }
                };
            }
            
            pu
            how to change dot shape with jfree polar plot?
            Javadot img2Lines of Code : 98dot img2License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            public static final Shape DEFAULT_SHAPE =
               new Rectangle2D.Double(-3.0, -3.0, 6.0, 6.0);
            
            DefaultPolarItemRenderer renderer = (DefaultPolarItemRenderer) polarPlot.getRenderer();
            renderer.setAutoPopulateSeriesShape
            JFreeChart setAutoRange when XYSplineRenderer is used as rendered
            Lines of Code : 70dot img3License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            rangeAxis.setAutoRange(true); // true by default
            rangeAxis.setLowerMargin(0.08); // 8% lower margin
            
            import java.awt.BasicStroke;
            import java.awt.Color;
            import java.awt.Font;
            import java.io.File;
            import java.io.IOEx
            How to create a gauge chart using JFreeChart
            Javadot img4Lines of Code : 54dot img4License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            public class TradeMeterChart {
            
                public void displayMeterChart() {
                    
                    RectangleInsets insets = new RectangleInsets(50.0, 5.0, 1.0, 50.0);
            
                    DefaultValueDataset data = new DefaultValueDataset(40);
                    MeterPlot p
            How to create a gauge chart using JFreeChart
            Javadot img5Lines of Code : 64dot img5License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import java.awt.Color;
            import java.awt.Dimension;
            import java.awt.EventQueue;
            import javax.swing.JFrame;
            import org.jfree.chart.ChartPanel;
            import org.jfree.chart.JFreeChart;
            import org.jfree.chart.plot.dial.ArcDialFrame;
            import org.jfree.
            Change the font size of the y-axis and x-axis values
            Javadot img6Lines of Code : 48dot img6License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            import java.awt.EventQueue;
            import java.awt.Font;
            import java.io.IOException;
            import java.text.DecimalFormat;
            import java.util.Random;
            import javax.swing.JFrame;
            import org.jfree.chart.ChartPanel;
            import org.jfree.chart.JFreeChart;
            import 
            JFreechart : how to customize each time series in a single dataset
            Javadot img7Lines of Code : 131dot img7License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
                public class Charts extends JFrame implements ChartMouseListener {
                
                        private TimeSeries priceSeries = new TimeSeries("Price");
                        private TimeSeries navSeries = new TimeSeries("Nav");
            
                        private ChartP
            Cannot load a thread that loads chart from JFreeChart until clicked
            Javadot img8Lines of Code : 333dot img8License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            private void createFrame1() {
                JLabel loading = new JLabel("Loading, please wait", SwingConstants.CENTER);
                loading.setSize(500, 500);
                loading.setAlignmentY(250);
                jPanel1.add(loading);
                jPanel1.revalidate();
                jPanel1.re
            JFreeChart disable vertical gray areas of XYPlot
            Lines of Code : 66dot img9License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            public class MyPlotChart {
                private static Color MetalColor = new Color(255, 152, 0);
                static double[] yData = new double[] { 49.68, 49.18, 49.78, 49.65, 48.94, 50.02, 50.27 };
                static String[] labels = new String[] { "2021-10-28"
            Recompute JFreeChart display on ChartPanel resize
            Javadot img10Lines of Code : 55dot img10License : Strong Copyleft (CC BY-SA 4.0)
            copy iconCopy
            cp.setMinimumDrawWidth(0);
            cp.setMinimumDrawHeight(0);
            // optionally
            f.setMinimumSize(new Dimension(
                cp.getMinimumDrawWidth(),
                cp.getMinimumDrawHeight()));
            
            import java.awt.BorderLayout;
            import java.awt.Dime

            Community Discussions

            QUESTION

            How to combine two polar charts?
            Asked 2022-Mar-29 at 17:28

            I founded a very interesting code that allows to combine two differents charts.

            I would like to do the same with two polar charts to permit multiple scale, but there is no renderer as line and shape or bar. Is there nevertheless a way to do that ?

            The aim is to plot to series with big dynamic difference like distance & site of laser shoots for each azimuth, something like that:

            CombineBarAndLineChartExample:

            ...

            ANSWER

            Answered 2022-Mar-29 at 17:28

            While I'm not aware of any support for nesting multiple polar plots with differing scales, jfreechart does support zooming, as described here. Absent a domain axis, zooming is limited to the range axis. Because the zooming controls may be counterintuitive in this context, the variation below adds plot-specific controls: The getZoomOutAction() simply invokes the chart panel's restoreAutoBounds() method, like this, while the getZoomInAction() extends the range by 50%, like this.

            Source https://stackoverflow.com/questions/71628281

            QUESTION

            how to change dot shape with jfree polar plot?
            Asked 2022-Mar-27 at 23:38

            I would like to know what are the methods to use to change dots polarplot size and shape . And also if it's possible to disable dots for this type of plot .

            here is the code plotting polar of two series with default dots.

            Thank you

            ...

            ANSWER

            Answered 2022-Mar-27 at 23:38

            with it, default dots are square.

            Yes, the DefaultPolarItemRenderer uses a 6 x 6 square DEFAULT_SHAPE:

            Source https://stackoverflow.com/questions/71632468

            QUESTION

            Error: This dataset already contains a series with the key Object 1
            Asked 2022-Mar-25 at 17:54

            Background: I am adding x & y values to a XYSeries dataset so I can render a jfreechart. Each of the x and y values are read in from a text file and are doubles. I've set the x and y values equal to the array location of the text and printed them out to check results. They are currently printing the correct results.

            The Problem: However, I'm having trouble adding the series to my XYSeriesCollection. So I created an XYSeries named series1 and added the two values in. Then when I go to add that series1 data to the XYSeriesCollection, it throws the: "This dataset already contains a series with the key Object 1" error.

            The Question: What does this error mean, and how do I solve it?

            Code:

            ...

            ANSWER

            Answered 2022-Mar-25 at 17:54

            An XYSeriesCollection distinguishes among the series it contains based on the Comparable key given to each series. In your example, that key is the String, "Object 1". Your loop that adds data to series tries to construct and add the series each time through the loop. Instead, create the series before the loop, add the data, and then add the complete series after it is filled:

            Source https://stackoverflow.com/questions/71619457

            QUESTION

            JFreeChart setAutoRange when XYSplineRenderer is used as rendered
            Asked 2022-Mar-09 at 23:23

            A chart needs to be plotted with smooth shape, so XYSplineRenderer is used. Also, the NumberAxis needs to be autoranged to the segment of data.

            But in some cases when the spline is calculated, some spline values are out of the autorange segment and the curve is not plotted entirely.

            Seems that the autorange is evaluated before the spline is calculated.

            To mitigate it, I have adjusted the range of the vertical axis by increasing this range by a percentage of the range limits. But this leads to inaccurate curve fitting to charts, since depending of the data input the percentage could be up to 25%.

            ...

            ANSWER

            Answered 2021-Nov-21 at 23:11

            As noted in JFreeChart adding trend-line outside of actual values, such anomalies are inevitable for functions that are not strictly monotonic. Absent more detailed spline control, you may get a better result by enabling auto-range on the problematic axis (the default) and adjusting the axis margin empirically.

            Source https://stackoverflow.com/questions/70021577

            QUESTION

            How to highlight a section in JFreeChart?
            Asked 2022-Mar-09 at 20:23

            My sample code looks like the following :

            ...

            ANSWER

            Answered 2022-Mar-09 at 20:23

            As seen here, concrete annotations require that coordinates be specified in data space. Given a Map.Entry hightlight of series indices to highlight, seen here,

            Source https://stackoverflow.com/questions/71402109

            QUESTION

            How to get X pixel value from date index or string in JFreeChart?
            Asked 2022-Mar-08 at 20:24

            I have the following sample app :

            ...

            ANSWER

            Answered 2022-Mar-08 at 20:24

            Given a ChartPanel, seen here, the following method finds the index item in the priceSeries and converts its time to Java2D coordinates relative to the chart.

            Source https://stackoverflow.com/questions/71385253

            QUESTION

            How to create a gauge chart using JFreeChart
            Asked 2022-Mar-02 at 19:51

            I want to create a gauge chart using a combination of pie chart and half donut chart. The expected image is attached. Can someone please help me to modify the attached code to get the expected result? Attaching the sample code, adapted from here:

            ...

            ANSWER

            Answered 2022-Jan-14 at 12:49

            Sharing the sample code with which I was finally able to achieve the desired chart. But the shape is somewhat distorted. Can someone help me figure out the error in this?

            Source https://stackoverflow.com/questions/70692566

            QUESTION

            How to ignore certain field of a third party class when deserializing with Jackson?
            Asked 2022-Feb-28 at 10:47

            I've got a class which contains field from JFreeChart, like XYPolygonAnnotation which contains itself Paint and Stroke.

            I can serialize it easily using an ObjectMapper. But when I try to deserialize it I've got some issues because Paint and Stroke are interfaces so it's impossible to have a constructor for them. I tried MixIn to deserialize them but it's not enough.

            ...

            ANSWER

            Answered 2022-Feb-28 at 10:47

            Well I manage to get a solution to make this work.

            Instead of loading directly a XYPolygonAnnotation I loaded it's attributes and recreated the object with this constructor :

            Source https://stackoverflow.com/questions/71062555

            QUESTION

            How to change JFreeChart vertical bar to a solid color?
            Asked 2022-Feb-08 at 00:45

            I have the following sample code for a JFreeChart, how to change the vertical bars to a solid color [ right now it has some white color in each bar ] ?

            ...

            ANSWER

            Answered 2022-Feb-08 at 00:45

            As shown here, use a StandardXYBarPainter to get a flat effect instead of the default gradient.

            Source https://stackoverflow.com/questions/71025895

            QUESTION

            Change the font size of the y-axis and x-axis values
            Asked 2022-Jan-19 at 00:43

            In the following code, I want to reduce the font size of the y-axis and x-axis values.

            I searched and found these code:

            suppose you want to reduce the font size of number axis use the following code:

            ...

            ANSWER

            Answered 2022-Jan-19 at 00:43

            This is a bug, reported in issue #98: setTickLabelFont is not respected for LogAxis if setNumberFormatOverride is used. It is fixed in branch v1.5.x. You can omit the override, use the workaround in the bug report, or build jfreechart-1.5.4-SNAPSHOT.jar, illustrated, like this.

            Source https://stackoverflow.com/questions/70758061

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install jfreechart

            You can download it from GitHub, Maven.
            You can use jfreechart like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the jfreechart component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            Install
            Maven
            Gradle
            CLONE
          • HTTPS

            https://github.com/jfree/jfreechart.git

          • CLI

            gh repo clone jfree/jfreechart

          • sshUrl

            git@github.com:jfree/jfreechart.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Explore Related Topics

            Consider Popular Java Libraries

            CS-Notes

            by CyC2018

            JavaGuide

            by Snailclimb

            LeetCodeAnimation

            by MisterBooo

            spring-boot

            by spring-projects

            Try Top Libraries by jfree

            jfreesvg

            by jfreeJava

            fxgraphics2d

            by jfreeJava

            jfreechart-fse

            by jfreeJava

            jfreechart-fx

            by jfreeJava

            orson-charts

            by jfreeJava