jfreechart

Graph Plot in JFreeChart

廉价感情. 提交于 2019-12-02 18:07:55
问题 On the X axis my data points(20 of them) take values between 0 and 0.2. My X axis should have range from 0 to 1. On the Y axis corresponding values are between 0.8 and 0.86. When I plot this graph using NumberAxis in JFreeChart I get very dense graph especially in the interval X belongs to 0.01 to 0.02.(so I can't see much) Is it meaningful to use log scale for X axis in this case? How should I adjust LogAxis in JFreeChart here? 回答1: To use LogAxis, just create the axis and set it as the plot

JFreeChart with truncated data points

孤街醉人 提交于 2019-12-02 17:56:12
问题 I have created a JFreeChart with the code below, but the Y-Axis marks are truncated. How should I display the chart even though the data points are overlapped in the Y-Axis? Basically, I want the Y-Axis points to be generated from my file, a proper range is populated and displayed in the chart. private static JFreeChart buildChart(TimeSeriesCollection dataset, String title, boolean endPoints) throws IOException { // Create the chart JFreeChart chart0 = ChartFactory.createTimeSeriesChart(

Displaying a jfreechart in a jsp page

 ̄綄美尐妖づ 提交于 2019-12-02 17:40:23
问题 I want to display a jfreechart chart in a jsp page. I have written code as follows - ... <% ChartCreator chart = new ChartCreator(); chart.createCategoryChart(); %> <img src = "chart.jpg"/> where the createCategoryChart() method creates the required jpg. It is stored in the eclipse folder(i have not put any path in my filename). I am not able to view the chart in the jsp page, but the file is created. What am I doing wrong? 回答1: I would suggest to use Servlet to create Chart. JSP is mainly

how to draw crosshair on stock barchart

大憨熊 提交于 2019-12-02 16:50:07
问题 Hi i want to draw cross hair on this barchar .Can somone help me.I jst want the cross hair to print X and y cordinates where my mouse is pointing or clicking.I m fine even if the cross hair prints X and Y cordinates on console .here's my code import java.awt.Color; import java.awt.Dimension; import java.io.BufferedReader; import java.io.FileReader; import java.text.DateFormat; import java.text.DecimalFormat; import java.text.SimpleDateFormat; import java.util.Date; import java.util

Join a rectangle annotation with another annotation in JFreeChart?

六月ゝ 毕业季﹏ 提交于 2019-12-02 16:38:35
问题 I have used XYAnnotation and drawn a rectangle in xylinechart . Now how can I join it with another rectangle annonation? 回答1: One way would be to use an XYLineAnnotation plot.addAnnotation(new XYBoxAnnotation( 0.5,0.5,1.5,1.5)); plot.addAnnotation(new XYBoxAnnotation( 4.5,3.5,5.5,4.5)); plot.addAnnotation(new XYLineAnnotation( 1.5,1.5,4.5,3.5)); 来源: https://stackoverflow.com/questions/13175274/join-a-rectangle-annotation-with-another-annotation-in-jfreechart

JDBCCategoryDataset - execute multiple queries

家住魔仙堡 提交于 2019-12-02 16:31:47
问题 I want to create three charts inside a JFrame using the JDBCCategoryDataset class. How can I give three separate queries? I gave three different queries in the dataset object, but the result was to display three similar charts. In addition, it executes the last query for all three. I have seen the way it is done with DefaultPieDataset given default (static) values, but I want to retrieve data dynamically from database. I know I can create several JDBCCategoryDataset objects? Is there a better

Pretty pie charts in JFreechart

我的未来我决定 提交于 2019-12-02 16:09:23
问题 Is it possible to get complex, beautiful colors for pie charts in JFreechart? I mean how can I achieve the colors like the image shown in the link? Is it possible using the RGB format, or do you need to use a different format? How can we do it. thank you for your help 回答1: You can specify the color using RGB values for each slice of the pie with PiePlot.setSectionPaint. Here is an example : DefaultPieDataset result = new DefaultPieDataset(); result.setValue("1", 40.); result.setValue("2", 30.

jfreechart - StackedBarChart customization

流过昼夜 提交于 2019-12-02 15:56:17
问题 I have below mentioned 4 xml files in which i have state & key & BuildDate. I need to represent the "state" information of "key" in a graph based on BuildDate. The x-axis should have past 6 days (w.r.t current date. suppose today is 7th Sept then the entry should be from 1st to 6th Sept). If there is an entry for the corresponding date in BuildDate feild then the state should be displayed as red or green (Failed - red, Success - green). Otherwise black should be displayed. I am mainly

How do I create a pie chart that displays the quantity of something registered by each someone?

Deadly 提交于 2019-12-02 14:03:07
问题 In my project, I want to display in the pie chart how many institutions each employee registered in the system. The institutions table contains a foreign key with the id of the employee who registered the institution, so every institution has an employee associated with it. I built the following code, but couldn't go further: //etc String query = "SELECT i.ins_id, f.fun_nome FROM instituicao i " + "JOIN funcionario f " + "ON(f.fun_id = i.ins_fun_id)"; PreparedStatement stmt = ConexaoDAO.con

Open new frame or chart when a bar or a bar chart is clicked

梦想与她 提交于 2019-12-02 13:56:58
问题 I have a bar chart which gets the dataset from the mysql database, and I am stuck on using the chartMouseClicked . Currently the code prints when clicked on x or y axis bars, as I learned in a previous question, but how do I set that when I click a particular bar on x or y axis and open a new frame or chart. Also an information box would be fine. private void lineChart() { // *************** ADDING BAR CHART FROM DATABASE ***************************** try { String sql = "select Region, Male,