jfreechart

failed to looping dataset in jfreechart

大兔子大兔子 提交于 2019-12-13 05:28:26
问题 It is possible to create a loop dataset in jfreechart ?. I have a List that contains data. Here is the code List<ReportChart> theDatas; public CategoryDataset createDataset() { DefaultCategoryDataset dataset = new DefaultCategoryDataset(); for (ReportChart reportChart : theDatas) { dataset.setValue(reportChart.getLevensthein(), reportChart.getMainFileName(), reportChart.getComparingFileName()); dataset.setValue(reportChart.getJaccard(), reportChart.getMainFileName(), reportChart

Java Swing passing variables to JFreeChart class

ε祈祈猫儿з 提交于 2019-12-13 05:13:28
问题 I need help with last one thing in my project. I need to pass 4 variables (named a, b, c and d) from JDialog to JFreeChart in another class. I have added checkpoints to see where it actually stops to be processed and the code is as follows: package calc.kalkulator; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import javax.swing.*; class PanelFunkcji extends JDialog implements ActionListener { private JLabel lA, lB, lC, lD; private JTextField tA, tB, tC, tD; private

JFreeChart x axis Format

六眼飞鱼酱① 提交于 2019-12-13 05:02:32
问题 How to format x axis labels? I have a chart(look at attach1) I need to change x axis labels to the labels in the next attach (but with the same chart) 回答1: To set the label of the axis (in your example "counts") call XYPlot plot = (XYPlot) chart.getPlot(); plot.getDomainAxis().setLabel("counts"); To change the number format of the axis call XYPlot plot = (XYPlot) chart.getPlot(); ((NumberAxis)plot.getDomainAxis()).setNumberFormatOverride(new DecimalFormat("0")); To change the visible range of

Usage of DatasetUtilities.createCategoryDataset in jfreechart in java

流过昼夜 提交于 2019-12-13 05:01:39
问题 I am creating a Stack Bar chart with ApplicationName on x axis and UserName on Y axis. I am using: CategoryDataset stackDataset = DatasetUtilities.createCategoryDataset("Users","App", double[][]data); It populates the StackBarchart labelling User1, User2 ,User3 on Y axis and similarly App1, App2 etc on X-axis. Problem: I have an arraylist of userName and applicationName like: userName = [Max, John,Willy] appname =[Google, Fb, Twitter] And these names i have to populate instead of user1 or

CardLayout with JFreeChart switching is not working

旧时模样 提交于 2019-12-13 04:25:35
问题 I encounter some problems with JFreeChart, here I explained what I'm creating:Random errors when changing series using JFreeChart. But now I have another related question. I have to ChartPanel in CardLayout to switch between the graphs when I click on tabbed pane. I've tried it with ordinary JPanel ( public class JPaintablePanel extends JPanel . It's showing some button with different name depending on the tab), and it works well. But the same thing with public class JPaintablePanel extends

How can I redirect my jfreecharts into the tabs?

流过昼夜 提交于 2019-12-13 04:19:23
问题 I have 6 tabs that are named for different zones (A,B,C,S,SH,W) and each show their own data from the csv file. Inside the csv file I have a columns of # milliseconds that I convert to Hour and minutes and the other column is the letter of the Zone (same as tabs). I can display the data on the tab but it just shows each of the zones data in one tab. I am trying to show each of the zone's data in each of their own tabs. How should I approach this? I already looked at this topic but it didn't

read XYPlot size after each change in ChartPanel

北慕城南 提交于 2019-12-13 04:08:43
问题 You know that getPreferredSize method exists for ChartPanel.I want a similar method for XYPlot.Because I have a background image, I will scale image for each plot size change in ChartPanel.XYPLot width is not important for me.I want to scale height of background. So I need to have size of XYPlot. Changes can be Windows resize changes, also you know that XYPlot size is affected from domainAxis items, Legend items. P.S: I know that I can read plot info in ChartEvent.I want to have coordinates

JFree chart by using servlet in jsp

╄→尐↘猪︶ㄣ 提交于 2019-12-13 04:02:05
问题 How can i draw a line chart by using Servlets and rendered Image? I wrote a servlet and create a chart.but i don't know how to display it on my jsp page. my servlet code: public class GraphGen extends HttpServlet { public void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { genGraph(req, resp); } public void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { genGraph(req, resp); } @SuppressWarnings(

Regarding bar chart/pie chart display using JFreechart and mysql database in eclipse

梦想与她 提交于 2019-12-13 03:43:57
问题 I am developing a simple application on Java EE platform using database as MYSQL and JFreeChart to generate 3D Bar Charts but 3D effect is visible but the bars are not seen on that background,thus I am unable to display the bars in bar chart and same is with when I try to do this with Pie Charts. Here is mine code: <%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%> <%@ page import="java.io.*" %> <%@ page import="java.sql.*" %> <%@ page import="org

Why is the data in a timeseriescollection chart don't appear correctly?

你说的曾经没有我的故事 提交于 2019-12-13 02:07:21
问题 I'm made ​​a chart timeseriescollection type. I'm fetching the following values ​​to the database. However when creating the graph, the values ​​shown are not entirely accurate. Can someone tell me why this happens? Only shows the date. Hours not appear correctly. Does anyone can help me solve this little problem please? I would be eternally grateful. Thank you all very much. Values from Database. select (CONCAT(data_registo, ' ', hora_registo)) as data, temperatura from registos where