jfreechart

Displaying all XYSeries at once in jFreeChart for improving speed

╄→尐↘猪︶ㄣ 提交于 2019-12-08 06:17:37
问题 Suppose that we need to display multiple XYSeries in a single XYSeriesCollection . My problem is that every time I add a XYSeries , the JFreeChart wants to update the chart and that slows down the process of displaying multiple XYSeries . What I want is similar to this: // Do not update the chart XYSeriesCollection.add(XYSeries1) XYSeriesCollection.add(XYSeries2) ... XYSeriesCollection.add(XYSeries10) // Update the chart How can I do this? 回答1: Construct a new XYSeriesCollection having the

URL for each box in stacked bar graph

半城伤御伤魂 提交于 2019-12-08 03:38:05
问题 I want to create a stacked bar graph as in url below (source: jpowered.com) I want to make hyperlink for each of the red ,violet and blue boxes.The graph is possible with jfree chart but i don't know how to make each of the individual bars as URL so that a click on it can refresh the page. Is it possible to do it with jfree chart? Does Jquery plot help in this case to make each box url enabled ?Please suggest. 回答1: I know that you can achieve something like this in jqPlot without much trouble

Creating a normal distribution graph with JFreeChart

倾然丶 夕夏残阳落幕 提交于 2019-12-08 03:15:04
问题 I am trying to make a normal distribution graph using the JFreeChart library. I am successful if I try to get one area under the graph. However I did not find a way on how get 2 areas under the graph. Here is the code for one side : public GrafHujungKanan() { Function2D normal = new NormalDistributionFunction2D(0.0, 1.0); dataset = DatasetUtilities.sampleFunction2D(normal, -4, 4, 100, "Normal"); XYSeries fLine = new XYSeries("fLine"); fLine.add(nilaiKritikal, 0); fLine.add(4, 0); (

Copy Image to Clipboard not working on Linux (Java AWT & SWT)

天涯浪子 提交于 2019-12-08 02:51:38
问题 I am developing an Eclipse RCP Application which includes JFreeChart. One of its features is to copy graphs to the clipboard in order to paste them into other applications but it does not work on Linux, There is a SWT sample where you can find a snippet that does not work in Linux. On the other hand JFreeChart implemented this on AWT as: Clipboard systemClipboard = Toolkit.getDefaultToolkit().getSystemClipboard(); Insets insets = getInsets(); int w = getWidth() - insets.left - insets.right;

Android Afreechart - Change point shape, thickness and color of line

限于喜欢 提交于 2019-12-08 02:45:35
问题 I am trying to change the shape of a line chart's points, in my app. I am using afreechart's TimeSeriesChart . I want to make this line fancy in terms of thickness, color and points shape. Where to change the code? which method will use for that? What I'm having now: (source: googlecode.com) What I want: om/svn/doc/screenshot/images/XYDrawableAnnotationDemo01.png) As you can see, in the first chart, the points of the line chart are opaque and rectangle(square?), and in the second one, they

How to construct and use TimeSeriesCollections

家住魔仙堡 提交于 2019-12-08 00:44:31
问题 I want to display some dates in the X axis of a chart, and here it is said that i have to use a TimeSeriesCollections object It seems that i have to add a TimeSeries to the TimeSeriesCollections, and that the TimeSeries has to be constructed using a RegularTimePeriod... I am a bit confused... Can you please explain me what i have to do? If possible can you provide some example code? Thanks 回答1: TimeSeriesCollections are made up of TimeSeries objects Use this method to add series to the

JFreeChart: How to plot a line graph and a scatter on same chart

谁说胖子不能爱 提交于 2019-12-07 17:47:35
问题 i have two sets of data int[] x1 = {1,2,3,4,5,6,7,8,9,10}; int[] y1 = {1,2,3,5,6,8,9,10,14,11}; int[] x2 = {1,2,3,4,5,6,7,8,9,10}; int[] y2 = {0,2,3,5,0,8,9,8,14,11}; int[] z2 = {1,2,3,1,2,3,1,2,3,1}; I want to plot the x1,y1 as an XYLineChart and then plot x2,y2 as a scatter on the same plot without a line. I also need each scatter point of xy,y2 to be a different color depending on the value of z2 (1=Color.red, 2=Color.green, 3=Color.blue) How can i do this? So far i have: JPanel panel_1 =

Set color for border of legend of JFree Chart

99封情书 提交于 2019-12-07 17:24:48
问题 Problem is formulated in title. Details: I have code in class-theme for set specific non-default-color for the border of legend frame. LegendTitle legend = jFreeChart.getLegend(); legend.setWidth(100); After this I need to set color for border of legend, but nothing like legend.setBorderColor(Color.green) I couldn't found. Help me, please. Thanks for replies. 回答1: You can specify a new color when you replace the legend's border: LegendTitle legend = chart.getLegend(); legend.setFrame(new

How to get max Y value from StackedBarChart (jFreeChart)?

血红的双手。 提交于 2019-12-07 15:50:14
问题 How to get the maximum axis value from a created chart? Here is how it is created: final JFreeChart chart = ChartFactory.createStackedBarChart("", "", symbol, dataSet,PlotOrientation.VERTICAL, false, false, false); I probably have to get the dataset from the chart and then get the maximum axis value from it. The dataset is DefaultCategoryDataset . 回答1: Just iterate through the CategoryDataset CategoryDataset dataset = createDataset(); for (int r = 0; r < dataset.getRowCount(); r++) { double

JFreeChart: how to change XYPlot foreground color?

北战南征 提交于 2019-12-07 15:11:42
问题 The JFreeChart XYPlot background color is changed using setBackgroundPaint() but there doesn't seem to be a corresponding setForegroundPaint() . XYPlot plot = (XYPlot) chart.getPlot(); plot.setBackgroundPaint(Color.BLACK); How is the foreground color (the plot) changed? 回答1: eg: XYItemRenderer renderer = plot.getRenderer(); renderer.setSeriesPaint(0, Color.CYAN); 来源: https://stackoverflow.com/questions/4052083/jfreechart-how-to-change-xyplot-foreground-color