Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa JSP-Servlet JFreeChart- Display coordinate value .

Have Programming Question? Ask it here!
 
 
 


Dijeesh V
JFreeChart- Display coordinate value .
1 Answer(s)      3 years and 4 months ago
Posted in : JSP-Servlet


How to Mark Coordinte value on top of the bar ?


Advertisement
View Answers

December 11, 2010 at 5:33 PM


Hi Friend,

Try the following code:

import java.io.*;
import java.text.*;
import org.jfree.data.*;
import org.jfree.ui.*;
import org.jfree.chart.*;
import org.jfree.chart.axis.*;
import org.jfree.chart.plot.*;
import org.jfree.data.category.*;
import org.jfree.chart.renderer.category.*;
import org.jfree.chart.labels.StandardCategoryItemLabelGenerator;

public class ChartDemo{
public static void main(String arg[]){
  DefaultCategoryDataset dataset = new DefaultCategoryDataset();
  dataset.setValue(60, "Marks", "A");
  dataset.setValue(75, "Marks", "B");
  dataset.setValue(40, "Marks", "C");
  dataset.setValue(90, "Marks", "D");
  dataset.setValue(20, "Marks", "E");
  JFreeChart chart = ChartFactory.createBarChart("Bar Chart","Student", "Marks", dataset, 
  PlotOrientation.VERTICAL, false,true, false);
  CategoryPlot p = chart.getCategoryPlot(); 
  NumberAxis rangeAxis = (NumberAxis) p.getRangeAxis();
  rangeAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits());
  BarRenderer renderer = (BarRenderer) p.getRenderer();
  DecimalFormat decimalformat1 = new DecimalFormat("##");
  renderer.setItemLabelGenerator(new StandardCategoryItemLabelGenerator("{2}", decimalformat1));
  renderer.setItemLabelsVisible(true);
  chart.getCategoryPlot().setRenderer(renderer);
  ChartFrame frame=new ChartFrame("Bar Chart",chart);
  frame.setVisible(true);
  frame.setSize(350,450);
    }
}

Thanks



Related Tutorials/Questions & Answers:
JFreeChart- Display coordinate value .
JFreeChart- Display coordinate value .  How to Mark Coordinte value on top of the bar
Jfreechart chart display problem
Jfreechart chart display problem  Using JSP and Jfreechart displays the chart fine on an internal browser in eclipse but doesnt display it on Chrome...="java.awt.GradientPaint" %> <% int value=Integer.parseInt
Advertisements
Using JFreeChart to display recent changes in a time series
Using JFreeChart to display recent changes in a time series  Using JFreeChart to display recent changes in a time series
How to display jfreechart at specified place in jsp
How to display jfreechart at specified place in jsp  I have a jsp page where i need to display the chart at specified position...("Inet", 20); JFreeChart chart = ChartFactory.createPieChart3D
jfreechart display from access database data.
jfreechart display from access database data.  I have made a database... to retrieve the data from the access database using prepared statement and then display the bar graph using jfreechart API .This whole retrieval and display of chart
How to display Jfreechart from servlet in jsp web page at specified location
How to display Jfreechart from servlet in jsp web page at specified... to display the chart in web page. I generated the chart using Jfreechart in Servlet which is in image format.plz sir give me the code to display this chart
jfreechart
jfreechart  hi how install jfreechart? and how free download jcommon? plz insert link for this? thanks   Hi Friend, Please visit the following link: Download JFreechart Download jfreechart-1.0.13.zip from the given
how to show value and percentage in piechart sections from database using jfreechart
how to show value and percentage in piechart sections from database using... jfreechart.Now I need to display the values and their percentage in the sections... JFreeChart setup and the basic servlet * configuration. * * @param
To store value in session & display it
To store value in session & display it  Hello..I m trying to run...="add"> <!-- <input type="checkbox" name="book1cat" value="JSP" />JSP <input type="checkbox" name="book1cat" value="C
Display of value in Tabel cell
Display of value in Tabel cell  I have added a custom field..., Object value , boolean isSelected, int row, int column){ JPanel...(editor.getTableCellEditorComponent(table, value, isSelected, row, column)); panel.add
. Display JavaScript dropdown selected value
you select any value from list, alert will display that. In var.... Display JavaScript dropdown selected value  How to get the selected value from dropdown box? I am using javascript.   <html> <
how to display the value of termcell name in label
how to display the value of termcell name in label  want to display the tercell name in label report of pending apllication of termcellname code...="display"%> <%@ taglib uri="/WEB-INF/tlds/struts-html.tld" prefix="html"%> <
java script display value - Java Beginners
java script display value  my code is below: my problem is: the value 'firstname' is not showed with getparameter in .jsp file? (when click submit button in form) Main file: Name: file java
how to display textbox value based on selected option value?
how to display textbox value based on selected option value?  Hi,I... on first value I finished above code. ID: xx Name:xx xx is baesd on second and first value. But it is that l can't do that. now, l post my code
JFreechart & JCommon
JFreechart & JCommon   hi........... thanks a lot. The code is running successfully and able to get the output. Thanks once again
Error in JfreeChart
Error in JfreeChart  I am getting an error when i am using jfreechart for graph generation, that is: D:\my\linechart.java:5: package org.jfree.chart... and download the jfreechart api: http://www.brothersoft.com/jfreechart
Error in JfreeChart
Error in JfreeChart  I am getting an error when i am using jfreechart for graph generation, that is: D:\my\linechart.java:5: package org.jfree.chart does not exist import org.jfree.chart.*; what is the reason and possible
how to use dropdown list in JSP and display value in same page
how to use dropdown list in JSP and display value in same page  I... one option the value must get displayed below it in the same page as: Value selected = B Now if choose another option, new message should be printed
how to display each arraylist value on new page in jsp
how to display each arraylist value on new page in jsp  hi!!!! i want to display each arraylist value on new page in jsp????? and also want to access the arraylist values using next button..... any help would be appreciated
I am not able to display the selected value of my combobox
I am not able to display the selected value of my combobox   <?php echo "<select name=\"hello\">\n"; echo "<option value=\"NULL\">...["unitcode"]; $i=$i+1; echo "<option value=''>$strB<
how to display data from database according to entered value in search field
how to display data from database according to entered value in search... BMI value and display the results accordingly. 1)search.jsp: <html> <...;/b></td> <td>: <input type="text" name="bmi_value" id="BMI
How to collect Java input field value display into Jtable?
How to collect Java input field value display into Jtable?  <p>... as the following information. - display the value in the JTable. If in the GUI as per view...;text rate - input interest rate</li> <li>text Result - Display
Box And Whisker Chart Example using JFreeChart
Box And Whisker Chart Example using JFreeChart... to create a box and whisker chart using JFreeChart. Code of the chart given below shows product value at different date . In the code given below we have
JFreeChart - An Introduction
JFreeChart - An Introduction       JFreeChart is a free open source java chart library. David Gilbert founded the JFreeChart project in February 2000. Now a days
how to install jfreechart in netbeans.
how to install jfreechart in netbeans.  I have successfully installed jfreechart in eclipse IDE.but I am unable to install the same in netbeansIDE 6.7.1 .There is some error regarding the ant folder.Please tell the step by step
Jfreechart zoomin and zoomout - Framework
Jfreechart zoomin and zoomout  how to zoomin and zoom out chart using button plus and minus or slide bar in jFree chart
Candle Stick Chart Example using JFreeChart
Candle Stick Chart Example using JFreeChart... a candle stick chart using JFreeChart. Code of the chart given below shows price value on the different dates. In the example given below we have
Jfreechart - Java Beginners
Jfreechart  Hi Team, Am very new to Jfreechart concept. And I was tried to configure Jfreechart in my system but I cant. Can any one pls guide me how to install and configure JFreechart from the basic with the necessary files
JFreechart Stacked Bar Chart
JFreechart Stacked Bar Chart JFreechart provides a way to create various... as the total value represented by data points from each series stacked in a bar... categories: girls and boys and display their interest regarding games. For example, 25
how to display the nearest palaces for the given latitude and longitude value in google map in android
how to display the nearest palaces for the given latitude and longitude value in google map in android  i m working in android. i need to display the nearest palaces with their image for the given latitude and longitude value
JFreeChart dosn't work
JFreeChart dosn't work  Hello everybody I'm trying to make a line chart from JFreechart, but I just can't get it to work. The graph get its data...(temp, "", dateinput); } JFreeChart chart
utiliser jfreechart dans portlet struts
utiliser jfreechart dans portlet struts  Bonjour. J'ai un pfe,et mon application m'impose d'utiliser jfreechart,je trouve juste la documentation de jfreechart avec struts2 seulement,mai je l'ai besoin ds un portlet liferay. vu ke
display
display  please tell me how to display the content from database.. if we click on any image using servlets/jsp...please
How to display data fom MySQL DataBase-table in to JSP file by submitting a value in combobox.
How to display data fom MySQL DataBase-table in to JSP file by submitting a value in combobox.   I have the same problem.plz help me. I have MySQL... have to display the Nodename and packageno. i.e.,select nodename,packageno from
base the value of first combo box, how i display the second combox - JSP-Servlet
base the value of first combo box, how i display the second combox    i have a combo box for classes. my requirement is when i select the class, if class is 11 or 12 the second combo box of subject should be appear. please
Re: base the value of first combo box, how i display the second combox - JSP-Servlet
Re: base the value of first combo box, how i display the second combox   Dear Sir, in this program when i click on submit button, the corrosponding value of combo box should be sent. but when i clicked to submit button, it do
Display JList value selected from the JOptionPane
Display JList value selected from the JOptionPane In this section, we are going to select the particular value from the JOptionPane combobox and displayed that value in the JList. For this purpose, we have created a button and JList
Re: base the value of first combo box, how i display the second combox - JSP-Servlet
Re: base the value of first combo box, how i display the second combox    thanks for your reply. i want to know suppose the second combo box appear only when i select the class 11th or 12th. please review. your answer
ChartFrame in Jfreechart - JSP-Servlet
the following code to display the chart: ChartPanel chartPanel = new
Jfreechart setting Legends - Java Beginners
Jfreechart setting Legends  Hi... i am using JfreeChart in my web app. for creating charts.I am trying to make the legends as vertical in Stacked bar chart. Does anybody know How to set the legends in any graph as vertical
Class files for Jfreechart - JSP-Servlet
Class files for Jfreechart  Respected Sir/Madam, I am Ragavendran.R.. I have downloaded Jfreechart 1.0.13 in my system for performing..... Regards, Ragavendran.R..  Hi Friend, Jar file Jfreechart 1.0.13
Create Histogram using Jfreechart
Create Histogram using Jfreechart In this section, you will learn how to create histogram using jfreechart. To create a Histogram, we have used...;      value[i] = generator.nextDouble
Graphs using JFreeChart - Java Beginners
(); dataset.addSeries(s1); dataset.setDomainIsPointsInTime(true); JFreeChart
Create a polar chart using JFreeChart
Create a polar chart using JFreeChart  ... a polar chart using JFreeChart. Code given below creates a simple polar chart... ApplicationFrame to create a frame and also pass a string value to the constructor
MySQL Boolean Value
MySQL Boolean Value       MySQl Boolean Value is used to display the Boolean type status of the field... Value'. To understand the example execute a query 'SHOW TABLE STATUS LIKE "
jfreechart displaying chart from access database
jfreechart displaying chart from access database  I have these 2... "Short description"; }// </editor-fold> } and a jfreechart file to display the chart.this is a separate java file. graph.java import
Stacked Bar Chart using JFreeChart
Stacked Bar Chart using JFreeChart   ... bar chart using JFreeChart. In the code given below we have extended class ApplicationFrame to create a frame and also pass a string value to the constructor
Category Step Chart Example using JFreeChart
Category Step Chart Example using JFreeChart... a category step chart using JFreeChart. Code of the chart shows you run rate... class ApplicationFrame to create a frame and also pass a string value
Combined Category Plot Example using JFreeChart
Combined Category Plot Example using JFreeChart... to create a Combined Category Plot chart using JFreeChart. Code for the chart shows... ApplicationFrame to create a frame and also pass a string value
 

 

 

DMCA.com