Skip to content
Advertisement

Tag: jfreechart

how to change dot shape with jfree polar plot?

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 with it, default dots are square. Yes, the DefaultPolarItemRenderer uses a 6

How to get X pixel value from date index or string in JFreeChart?

I have the following sample app : How to implement the 2 “getX()” methods above, so they will return the X pixel values by inputting date index or date string ? Answer 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. The TimeSeries

How to change JFreeChart vertical bar to a solid color?

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 As shown here, use a StandardXYBarPainter to get a flat effect instead of the default gradient. I tried, but didn’t work: renderer2.setDefaultBarPainter(new StandardXYBarPainter()). Note that XYBarRenderer.setDefaultBarPainter() is

Change the font size of the y-axis and x-axis values

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: suppose you want to reduce the font size of CategoryAxis use the following code: but unfortunately, the size of the axes did

Unable to display center text in ring chart

I am trying to generate a donut or ring chart using jfree chart library. Ringchart was generated successfully but only the problem is centered text inside ring was not displaying. The following is the sample snippet. chart generation code And centered text related code is like below I am using jfreechart verison 1.5.0 Answer It’s not clear where your fragment

PlotOrientation of BoxAndWhiskerChart JFreeChart

I have a question about JFreeChart: Is it possible to change the PlotOrientation of a BoxAndWhiskerChart to horizontal? I have a histogram, and I want to add a BoxAndWhiskerChart below. I need it horizontal so I can use the same axis scale. I tried to change the orientation in the Plot and ChartPanel. Answer @Catalina Island shows the correct way

Let users edit series in JFreeChart XY plots

I’m using JFreeChart to make some graphs in a Java application. I’m trying to figure out how to let the user edit the series paint/stroke. In the Chart Properties window there’s a spot for this, but it just says “No editor implemented”. Is there a way through the API to provide JFreeChart with an editor for these properties, or do

JFreeChart with truncated data points

I have created a JFreeChart with the code below, but the Y-Axis marks are truncated. How should I display the chart even though the data points are overlapped in the Y-Axis? Basically, I want the Y-Axis points to be generated from my file, a proper range is populated and displayed in the chart. Below is the image that is created,

Advertisement