jfreechart

jFreeChart: How to hide items from legend?

大城市里の小女人 提交于 2019-12-05 04:57:25
I need to hide every second/third/forth item from the legend. IS there a way to achieve this in jFreeChart? thanks! Jason I have tried the above suggestion but it didn't seem to work for me. If you just want to remove series from the legend you can do it with the setSeriesVisibleInLegend() method. My scenario was that some of my series do not have a legend key. If they don't have a legend key then the series shouldn't be visible in the legend. I implemented this with the following code: for(int i = 0; i < seriesList.size(); i++){ if(seriesList.get(i).getKey() == null || seriesList.get(i)

Jfreechart - any option for multiple XY charts like with the multi pie plot?

…衆ロ難τιáo~ 提交于 2019-12-05 03:01:48
问题 Is there anything similar to the multiPiePlot Chart but for xy plots? I have an application that needs to print two or three xy plots on one page. I know you can put multiple data sets on the same plot, but the requirements specify that each must be a separate chart on the same page. 回答1: Yes, simply add your ChartPanel instances to a JPanel having GridLayout(0, 1) for a top-to-bottom arrangement. This example uses an orthogonal GridLayout(1, 0) to set three panels across. 回答2: I used the

Change font-size of domain axis label and range axis label for jfreechart

有些话、适合烂在心里 提交于 2019-12-05 00:11:42
My goal is to increase the size of "Revenue ($) " and "Years" . But I do not know how. I am able to increase the "Apples, Durians,Oranges" and "2012, 2013". Below are my codes. JFreeChart chart = ChartFactory.createBarChart3D("", // chart title "Years", // domain axis label "Revenue ($)", // range axis label dataset, // data PlotOrientation.VERTICAL, // orientation false, // include legend false, // tooltips false); CategoryPlot plot = chart.getCategoryPlot(); CategoryAxis axis = plot.getDomainAxis(); CategoryPlot p = chart.getCategoryPlot(); ValueAxis axis2 = p.getRangeAxis(); Font font = new

CrossHair Tracing In JFreeChart

安稳与你 提交于 2019-12-04 19:42:24
I was able to implement real-time mouse tracing as follow : The source code is as follow : http://jstock.cvs.sourceforge.net/viewvc/jstock/jstock/src/org/yccheok/jstock/charting/CrossHairUI.java?revision=1.5&view=markup http://jstock.cvs.sourceforge.net/viewvc/jstock/jstock/src/org/yccheok/jstock/gui/ChartJDialog.java?revision=1.9&view=markup However, I unable to obtained the correct y screen coordinate, when an subplot being added. (broken image) I suspect I didn't get the correct screen data area. When there is only one plot in the screen, I get a screen data area with height 300++ When a

How to avoid negative values with JFreeChart fixed auto range

主宰稳场 提交于 2019-12-04 17:27:16
I have a JFreeChart line plot that is updated dynamically with one data point for every iteration of my algorithm. Because the number of data points can quickly become very large, I have used the setFixedAutoRange(double) method on the domain axis. This restricts the graph to displaying the n most recent iterations (200 in my case). This works well, except during the first 200 iterations. The problem is that, until there have been 200 iterations, the axis includes negative values (for example, after 50 iterations, the range is from -150 to 50). Negative iterations make no sense. I would like

how to start draw line from X - Y axis at o in JFreeChart ChartFactory.createLineChart

落花浮王杯 提交于 2019-12-04 16:11:06
i am creating line chart using JFreeChart . Line chart draw properly but i want to start at point 0. how can i do that? public void lineChart() { CategoryDataset ds=createDataset2(); chart2=ChartFactory.createLineChart("Bar Chart", "OPD Number", "Weight", ds,PlotOrientation.VERTICAL,true,true,false); ChartPanel cp = new ChartPanel(chart2); jp.add(cp); //jp is JPanel } public CategoryDataset createDataset2() { final DefaultCategoryDataset dataset= new DefaultCategoryDataset(); final String series1 = "Type1"; OPDDetailBean ob=new OPDDetailBean(); ArrayList<OPDDetailBean> aob=new ArrayList

JFreechart, Line Chart with filled Areas

百般思念 提交于 2019-12-04 14:26:52
I am trying to create chart like below: While I've almost achieved everything by simply creating a line chart and customizing shape/paint for Renderer, I can't seem to find a way to fill the areas under the series line. Any clues, how can I do this? You could create your chart with a StackedXYAreaRenderer . Specify AREA_AND_SHAPES in the constructor and enable outlines. See the ChartFactory code for createStackedXYAreaChart() as an example. StackedXYAreaRenderer r = new StackedXYAreaRenderer(XYAreaRenderer.AREA_AND_SHAPES); r.setOutline(true); Given a renderer, you can set the outline paint

JAVA Library for charts- JFreeChart? [closed]

别来无恙 提交于 2019-12-04 14:07:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . first of all: I did read all the other similar questions and i have taken a look at JFreeChart, which seems to be the weapon of choice for producing charts for a Java desktop app. It would actually suit my needs too, but the project seems to be dead.The forums are down, last update was in 2009. Question is, is

Is it possible to customize label for each category in bar chart?

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-04 12:04:36
Recently I get a requirement to create a bar chart that show data for each project. Here's an example : As you can see, the Category is the name of the project, and Series are different types of data in that project. However, since system dose not guarantee the uniqueness of project name, using it as categories can cause problem, and I will not able to use project name to generate URL for different projects. On the other hand, If I use unique id as category, I won't able to display the project name. This put me into a difficult situation. So my problem is : Is there a way to generate customize

JFreechart(Java) - How to draw lines that is partially dashed lines and partially solid lines?

送分小仙女□ 提交于 2019-12-04 11:19:56
I'm going to plot a line chart that will change from solid line to dashed line to to indicate real data and forecasting data. I'm not sure if i need to extend some of the classes like XYLineAndShapeRenderer or something else, or maybe there is some convenient way to achieve this? Here is a demostration graph i plotted using Excel. I am talking about the gray lines in the graph. That is what i want. I don't know if there is a renderer that allow me to indicate which range dashed or solid There are two ways I can think of for doing this. Neither of them are elegant, but that may be the reality