jfreechart

JFreeChart: how to get coordinates of an XYItemEntity? [duplicate]

微笑、不失礼 提交于 2020-02-05 05:42:05
问题 This question already has an answer here : JFreeChart:how to get coordinates of a ChartEntity and snap mouse cursor to the top of it? (1 answer) Closed 4 years ago . I've been stuck with this problem for quite some time. I need coordinates of certain points that belong to XYItemEntity. I'm drawing candlestick charts, and want to know what are the coordinates of open, close, high, low prices of the item. Is there any way to achieve that? EDIT: The question is similar to this one: https:/

How to set same scale for domain and range axes JFreeChart

≯℡__Kan透↙ 提交于 2020-01-26 10:54:06
问题 I would like to create pole/zero plot similar to pole/zero plot. It is for displaying IIR and FIR filters properties like stability, type... My question is: How can I set same scale (not range) for both axes? I use ScatterPlot for chart. JFreeChart chart = ChartFactory.createScatterPlot("Pole/zero plot", // chart // title "real", // x axis label "imaginary", // y axis label result, // data PlotOrientation.VERTICAL, true, // include legend true, // tooltips false // urls ); XYPlot plot =

Dynamically update a pie chart in an Observer?

情到浓时终转凉″ 提交于 2020-01-25 07:22:06
问题 I am using pie chart to display some statistics in a JFrame using JFreeChart package. I am using the PieDataset to be passed to the createChart method. Also, the datatset is set to update dynamically, as I am using the observer pattern in my application, which I thoroughly debugged. My issue is that in spite of being able to update the datatset dynamically, the piechart on the frame does not update as it is, maybe not able to take the new (updated) values and display the result. I would like

Java - Convert OffsetDateTime/ timestamp to RegularTimePeriod to plot time series graph (Jfreechart)

落花浮王杯 提交于 2020-01-25 06:57:12
问题 I currently trying to plot a graph using Jfreechart , and it accept only RegularTimePeriod My date String is: zzz ***Wed Jan 15 10:00:03 +08 2020 From this Question I learned to parse such a string into an OffsetDateTime object. By calling OffsetDateTime I get this string: 2020-01-15T10:00:03+08:00 Then I was trying to make it into RegularTimePeriod , specifically "second". I'm lost and confused about the conversion. Here is my code: TimeSeries s1 = new TimeSeries("Something");

JFreechart series movement with fixed x-axis

喜你入骨 提交于 2020-01-25 00:22:13
问题 First question here. I'm doing an Arduino serial port plotter with Java and JFreeChart. Everything's working fine with the DynamicTimeSeries dataset, as I'm able to plot data nice and softly. What I need to do now is this: given an established period of time (let's say 60 seconds) I want to plot the DynamicTimeSeries dataset on the chart for that period without moving the axis; I mean, like drawing a line for 60 seconds on the fixed chart. Is there any way to do this? Every example I've

JFreeChart | How to add percentage to top of each bar and format domain axis (X axis) ticklabels?

孤人 提交于 2020-01-24 18:58:20
问题 I'm using JFreeChart and following is a screenshot of the developed chart by me and the related code. private void getBarChart(List<Data> data) { JFreeChart barChart = ChartFactory.createBarChart("", "", "", createDataset(data), PlotOrientation.VERTICAL, false, true, false); CategoryPlot plot = barChart.getCategoryPlot(); plot.getRenderer().setSeriesPaint(0, new Color(7, 43, 97)); barChart.getCategoryPlot().getRangeAxis().setLowerBound(0); barChart.getCategoryPlot().getRangeAxis()

Adding text not related to sections into Legend in JFreeChart PieChart

依然范特西╮ 提交于 2020-01-22 10:06:47
问题 Is there a way to include some arbitrary text in the legend in a JFreeChart PieChart? I know it's possible to assign a PieSectionLabelGenerator in order to customize the labels of each of the Pie's sections that appear on the chart's legend. I'd like to insert some text into the legend, completely unrelated to any of the pie sections, like, for instance, "Legend". I'm building the Chart like this: private JFreeChart constructChart() { List<Object[]> llistaValorsArr; ParamsDTO dto = (ParamsDTO

Adding text not related to sections into Legend in JFreeChart PieChart

笑着哭i 提交于 2020-01-22 10:06:31
问题 Is there a way to include some arbitrary text in the legend in a JFreeChart PieChart? I know it's possible to assign a PieSectionLabelGenerator in order to customize the labels of each of the Pie's sections that appear on the chart's legend. I'd like to insert some text into the legend, completely unrelated to any of the pie sections, like, for instance, "Legend". I'm building the Chart like this: private JFreeChart constructChart() { List<Object[]> llistaValorsArr; ParamsDTO dto = (ParamsDTO

Drawing annotation shapes without graph scaling

岁酱吖の 提交于 2020-01-21 19:53:26
问题 I'm creating graphs using JFreeChart: The problem should be fairly clear. My circles which I'm drawing on the graph are showing up as ovals, since my graph is being scaled down to fit within my dimensions. Here's how I'm drawing the circle annotations: chart.getXYPlot().addAnnotation( new XYShapeAnnotation( new Ellipse2D.Float(pointX - 15, pointY - 15, 30, 30), new BasicStroke(0.5), Color.BLACK, Color.GREEN ) ); How can I draw an annotation without it being scaled down? Is there a way to draw

Combining XYPlot and TimeSeries elements in JFreeChart

廉价感情. 提交于 2020-01-20 08:45:06
问题 I am interested in making a sort of hybrid between an XY Chart and Time Series in JFreeChart, where the x-axis is some SimpleDateFormat element (say, "yyyy-MM-dd HH:mm:ss.SSS"), with a respective start and end in the domain that is in this format, and the y-axis are levels, say LOW, MEDIUM, and HIGH. For each specific date/time, I would like to plot one of these three levels. How might I go about doing this? 回答1: You'll need to combine several elements to get the desired effect: Start with