jfreechart

Code for changing the color of subtasks in Gantt Chart

我只是一个虾纸丫 提交于 2019-11-26 02:15:17
问题 I need to change the color of subtasks in a Gantt chart. My example is based on GanttDemo2 with the following dataset and renderer. In different forums I found some discussions related to this topic, but I did not find a clear simple working example. In particular, I can change the color of tasks, but I don\'t know how to extract subtasks. private IntervalCategoryDataset createSampleDataset() { final TaskSeries s1 = new TaskSeries(\"Scheduled\"); final Task t1 = new Task( \"Design\", date(1,

Changing mercury color in thermometer in JFreeChart

▼魔方 西西 提交于 2019-11-26 01:54:40
问题 I have created a thermometer chart with JFreeChart, but I want to change the mercury color in thermometer. How can I do this? Here is my code so far; please explain where to change this code: final DefaultValueDataset dataset = new DefaultValueDataset(new Double(10)); // create the chart... final ThermometerPlot plot = new ThermometerPlot(dataset); final JFreeChart chart = new JFreeChart(\"Thermometer Demo 2\", // chart title JFreeChart.DEFAULT_TITLE_FONT, plot, // plot false); // include

How can I put axis on a .png file in java?

假装没事ソ 提交于 2019-11-26 01:34:39
问题 I have chart.png with data in it that I would like to put a simple X - Y axis on with some labeling. I also would like to try not to use any external software that doesn\'t come with java. I\'m allowed to use jfreechart but if there is a way to make it look nice, while just using some plan java code, that would be better. Does anyone have a good idea about how to do this sort of thing? Update: Something like this but the data would be color coded with rgb values and of course there would be

JFreeChart scaling of Boxplots with several Categories

£可爱£侵袭症+ 提交于 2019-11-26 00:56:14
问题 i am currently working on a java-based project using JFreeChart to display boxplots. My Problem is how to display a chart containing boxplots for a CategoryDataset with about 20 Categories and 5+ Series. Currently if the preferred size of the ChartPanel is not set, the Legend, Labels and Annotations are readable but the Boxplots are too small. Or the size of the ChartPanel is set so that the Boxplots have an acceptable size but then the legend, labels and annotations are horizontally

CombinedDomainXYPlot not rescaling domain axis

我的未来我决定 提交于 2019-11-26 00:17:08
问题 When I hide number of series from a chart that is using a CombinedDomainXYPlot, all range axes are auto rescaled nicely. Howver, the domain axis does not get rescaled. Is there any way to manually refresh scaling, or perhaps there is a setting I am missing to enable auto scaling of a domain axis in this setting? 回答1: CombinedDomainXYPlot establishes the combined maximal Range for its shared domain axis in getDataRange() . This is required to allow the axis to be shared. Changing the

Random errors when changing series using JFreeChart

你离开我真会死。 提交于 2019-11-25 22:06:30
问题 I\'m making a GUI that display result of background calculations. But before that, I wanted to test changing the dataset. Here is my code: DefaultXYDataset dataset = new DefaultXYDataset(); @Override public void run() { // TODO Auto-generated method stub for (int i = 0; i < periods; i++) { series[0][i] = (double) i; series[1][i] = 0; } dataset.addSeries(\"Series0\", series); for (int it = 0; it < 10; it++) { series[1][random.nextInt(periods)] = random.nextInt(100) / 2; double[][] d = new

How can I update a JFreeChart&#39;s appearance after it&#39;s been made visible?

不打扰是莪最后的温柔 提交于 2019-11-25 21:56:37
问题 How can I use JFreeChart to dynamically update a chart\'s appearance after it\'s been made visible? 回答1: The class ChartPanel is convenient for this, as it has methods to control the chart's overall appearance, including properties and zoom state. In addition it's also possible to access the chart's components, as shown below. This related example illustrates a JToolBar of zoom buttons. import java.awt.BorderLayout; import java.awt.EventQueue; import java.awt.FlowLayout; import java.awt.event