jfreechart

Java Swing - How to speed up program

孤街浪徒 提交于 2019-12-12 03:19:52
问题 I wrote the program on the basis of JFreeChart library. Possibility of change of points of the diagram, creation of new diagrams online, scaling, etc are realized in my program. A problem that the program works slowly if there more than 30 plots. How it is possible to speed up the program? I can show a code, but I don't know, whether there is a sense. Also I don't know, on what part of a code leaves most of all computer resources. How can I find this parts of code? I work in NetBeans. 来源:

JFreechart - vertical X-axis labels on an XYChart

笑着哭i 提交于 2019-12-12 03:05:12
问题 I have an XYLineChart, where the labels on the X axis are written horizontally. I would like to be able to write them vertically (descending). I can already do this for BarCharts: CategoryPlot plot = (CategoryPlot) chart.getPlot(); final CategoryAxis domainAxis = plot.getDomainAxis(); domainAxis.setCategoryLabelPositions(CategoryLabelPositions.DOWN_90); but an XYChart returns an XYPlot, rather than a CategoryPlot, and the getDomainAxis() of an XYPlot returns a ValueAxis, not a CategoryAxis.

How can I resize the charts on a JFrame automatically?

一曲冷凌霜 提交于 2019-12-12 03:02:59
问题 I have wrote a code that creates two scatters and two JPanels placed on a JFrame. However I could not make them fit automatically to the size of the window when it is being resized. Here is the code for one of the drawing classes: class ALTCanvas extends JPanel{ private static final long serialVersionUID = 1L; private XYSeries alts = new XYSeries("Altitude"); public ALTCanvas() { final ChartPanel chartPanel = createDemoPanel(); this.add(chartPanel, BorderLayout.CENTER); } private void update

jfreechart - setting the bar column color based on the state in StackedBarChart

泪湿孤枕 提交于 2019-12-12 02:58:33
问题 I have 2 questions: How to set the date axis range in jfreechart? The starting date should be 6days before current day & end date should be current day. So that there would be only 7 values in x-axis (dateaxis). I am trying the following code, but it is not working: XYPlot plot = (XYPlot) jfreechart.getPlot(); dateaxis.setDateFormatOverride(new SimpleDateFormat("dd/MM/yyyy")); plot.setRangeAxis(dateaxis); How to set specific color for the specific column of bar based on the state value? i.e,

How to to refresh the chart in ChartPanel class after loading the file?

大憨熊 提交于 2019-12-12 02:58:01
问题 I have four classes: - ChartService - CSVReader - FileChooser - ChartPanel My problem is that I don't know how to to refresh the chart in ChartPanel class after loading the file in the FileChooser class. I tried in different ways but the chart doesn't appear. Please help !!! ChartService Class : public void initializeChart() { final CombinedDomainXYPlot plot = new CombinedDomainXYPlot(new DateAxis("Time")); this.datasets = new TimeSeriesCollection[SUBPLOT_COUNT]; for (int i = 0; i < SUBPLOT

How to make jfreechart displaying the tooltip point information faster

自闭症网瘾萝莉.ら 提交于 2019-12-12 02:56:03
问题 I would like to make the point info tooltip appear faster. How can i do it? with the default setting I have to hover the mouse onto the point, then wait to be able to see point coordinate information. I want the point coordinates to be immediately available. How can i do that? 回答1: ChartPanel provides getInitialDelay() and setInitialDelay() to query and alter "the initial tooltip delay value used inside this chart panel." As a concrete example based on BarChartDemo1, the following change to

JFreeChart not showing in generated Spring MVC and iText PDF

▼魔方 西西 提交于 2019-12-12 02:42:17
问题 I asked before the question "Append PDF at the available space of another PDF file" and I have successfully made a PDF with both native iText and JFreeChart combined in one page. I merged this setup to my Spring MVC application using the tutorial "Spring Web MVC with PDF View Example (using iText 5.x)". I understand that using Spring's AbstractView and in turn implemented as @Override protected void buildPdfDocument(Map<String, Object> map, Document document, PdfWriter pdfWriter,

Adding a JChart to a panel

守給你的承諾、 提交于 2019-12-12 02:27:54
问题 Im new to using APIs. I am trying to get a chart showing on a panel. I have already set up the libs and they are working. The API im using is JFreeCharts. I made a class called JChart: public class JChart extends JFrame { private static final long serialVersionUID = 1L; public JChart(String applicationTitle, String chartTitle) { // This will create the dataset PieDataset dataset = createDataset(); // based on the dataset we create the chart JFreeChart chart = createChart(dataset, chartTitle);

JFreeChart adding trendline outside of actual values?

强颜欢笑 提交于 2019-12-12 02:04:36
问题 I generate a chart using three data series (using XYSplineRenderer in JFreeChart) and for some reason the blue and red curves have an almost polynomial fit in some spots. The program seems to think there is an imaginary data point above and below the curve. Any ideas? Thanks! 回答1: An XYSplineRenderer "connects data points with natural cubic splines," so the effect is expected. You might look at adjusting the precision , as shown here. 来源: https://stackoverflow.com/questions/23452585

JFreeChart Text Annotations not Working?

守給你的承諾、 提交于 2019-12-12 01:39:46
问题 I seem to be getting problems with test annotations in JFreeChart XYPlot. I can set a text annotation as follows XYTextAnnotation textAnnotaion = new XYTextAnnotation(description, xMid, yMid); plot.addAnnotation(textAnnotaion); I can also rotate the text by adding textAnnotaion.setRotationAngle(90.0); But if I try to change the font type/size or colour it doesn't seem to work textAnnotaion.setFont(new Font("Tahoma", Font.BOLD, 20)); textAnnotaion.setPaint(new Color(255, 255, 255, 15)); The