Making Pie Chart For Values That The Row Contain

Mar 9, 2014

I use JTable and JScrollpane in my java application, and I would like for every selected row in the scroll pane, the pie chart to be made for the values in % that the row contain.

View Replies


ADVERTISEMENT

Program That Read Sequence Of Input Values And Display Bar Chart

Oct 21, 2014

Write a program that reads a sequence of input values and displays a bar chart of the values, using asterisks, like this:

********************** **************************************** **************************** ************************** **************

You may assume that all values are positive. First figure out the maximum value. That value's bar should be drawn with 40 asterisks. Shorter bars should use proportionally fewer asterisks.

import java.util.Scanner;
import java.util.ArrayList;
import java.util.Arrays;
public class Array717
{
public static void main( String[] args )

[Code] ....

The problem is that all this code does is print 1 line of *'s and what seems to be thousands of them

View Replies View Related

How To Create A PIE Chart

Jan 14, 2014

Here is the application that does this; test your coding of class PieChartWriter with it.

import java.awt.*;
public class TestPieChart
{ public static void main(String[] args)
{ PieChartWriter p = new PieChartWriter();
p.setTitle("How I spend my day");
p.setSlice1("Sleep: 7 hours", 7, Color.black);
p.setSlice4("Recreation: 9 hours", 9, Color.gray);
p.setSlice2("In class: 3 hours", 3, Color.blue);
p.setSlice3("Homework: 5 hours", 5, Color.red);
}
}

View Replies View Related

Bar Chart With Asterisks

Oct 12, 2014

I need to make a loop that prints out a certain number of asterisks, depending on the random number generated (includes 0-24, not including 25). I'm just in basic java programming and am stuck on this task.

These are the directions given to me:

Write a loop to do the following tasks 10 times:
-Generate a random number in the range of 0 to 24 and store in an int variable named: score
-Write loop to print a bar of asterisks proportional to the value in score :

For example: , if value stored in score is 8, the bar chart should like as follows: (value of score spaced by a tab ( ) and a series of 8 asterisks in one line)
8 ********
//end of the loop

I've tried looking for other questions like this, but this one is a random number, with no input. Yes, I know there are easier ways, but my professor is extremely picky with everything.

This is what I have so far:

public class PA5LoopsA {
public static void main(String [] args) {
//Declare variables
int score;
//Generate random number between 0 and 24
score = (int) (Math.random() * 25);

[Code] ....

Clearly, none of my formatting went through...yes, I know how to space everything out!

View Replies View Related

Bar Chart With Asterisks?

Oct 19, 2014

Here is the assignment instructions:

Overview: Use the Eclipse Java environment to create and test a program using methods that will display a bar graph.

Specifics: This assignment is an extension of the Module 5 activity, the first bar chart (asterisk) display program. You should also make use of the Bar Chart printing program of Chapter 6 (Fig. 6 in the textbook, p. 217).

Your program should use methods to accept input from the keyboard, store it in an array, and use that data to display a bar graph.

Pseudocode for the program might look like the following.

Main
declare an array of integers
get the number of asterisks in each bar
print the bar graph
get the number of asterisks in each bar
declare a Scanner input object
declare an array to fill and return

[code]....

Problem is I cannot get it to display the number of asterisks I enter as input.

View Replies View Related

Creating A Chart For Work?

Mar 6, 2015

I need to create a chart for work and comes across this sample from mbostock's chord diagram (bl.ocks.org/mbostock/4062006).

I only need to revise the tick label (names, display positions) but I don't know how to do it as I have 0 experience with Java.

My sample data for the var matrix is

[0,100,100,100]
[0,0,99,98]
[0,0,92,84]
[0,99,0,0]

which shows flows between country A, B, C and D.

I would like to revise the tick labels, so that:

1) Instead of showing 0K 5K 10K, I would like to show the country names (A - D), with no number or tick. I figured out this one by just commenting out all the codes relating to ticks.

2) Place the country names in the center of the arch. I don't know how to do this one.

View Replies View Related

JSF :: Organizational Chart In Primefaces

Dec 31, 2013

I would like to create this type of chart with Primefaces (or another JSF API), what is the best component to use to do this:

[URL] .....

View Replies View Related

Displaying Pie Chart In JScrollPane

Mar 12, 2014

I have a JScrollPane and JTable inside. In the right column of the table at the end (south) I made a ChartPanel in one of the classes where I make the design for the Frame:

Java Code:

ChartPanel chartpanel = new ChartPanel(pieChart);
pCapturing.add(chartpanel, BorderLayout.NORTH); mh_sh_highlight_all('java');

And when I click on any row above, from the list in the column, I would like an appropriate pie chart to be drawn.

I need here (in another class where I define the getTableCellRendererComponent) to enter a code to display the chart in the last row of the panel:

Java Code:

PieChart3 pie=sectionsChartProvider.getSectionPieChart(section);
...
...
if((hasFocus) || (isSelected)) {
if(column == 0)
setBorder( new MatteBorder(1, 1, 1, 0, colorBorder) );

[Code] .....

But, I don't know how to do this. I also have a class for drawing the pie chart.

View Replies View Related

Class Can't Implement Chart

Mar 10, 2014

i'm getting cryptic error messages for the following code:

class MyChar implements CharSequence{
private String s;

public MyChar(String input)
{
StringBuilder b = new StringBuilder(input);
b.reverse();
this.s = b.toString();

[code]....

it's telling me something's wrong with the class modifier and that my class can't implement chart

View Replies View Related

Seating Plan / Chart

Sep 15, 2014

I want to develop a seating chart/plan where people can pick their seat etc. I have developed the UML diagrams etc for this project and want to start with a console version before developing a GUI version. Eventually I want to create a website where users can log in and reserve their seats etc.

Without sounding like I'm putting the cart before the horse, I want to know what Java technologies I will need to develop the final part of the project. At the moment I'm using Eclipse for getting through the Java text books.

View Replies View Related

Administrative Chart Plotting

Feb 18, 2015

I want to plot an administrative chart(flow chart of an organization) and I truly do not not know how to start.

* Collect data from database
* use jgraph or any other api to create the flow chart.

View Replies View Related

Print Array Asterisk Bar Chart

Jul 6, 2014

I am trying to get this program to take 5 integers from a user and print a bar chart made of asterisks. The only way I've been able to access the values stored in the array is when my loops are nested, but this keeps my output from printing the way I would like it to.

It prints:
Enter a number:
2
**
Enter a number...and so on

I want it to take the values say(2,3,5,8,4) and do this:
**
***
*****
********
****

public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner in = new Scanner(System.in);
int[] barArray = new int[5];
for(int i =0; i < barArray.length; i++){
System.out.println("Enter a number: ");
barArray[i] = in.nextInt();
for(int j = 0; j < barArray[i]; j++){
System.out.print("* ");
}System.out.println("");
in.close();
}
}

View Replies View Related

Creating Chart Of Data - SerialPorts

Apr 10, 2015

I'm creating a small program that will be able to chart data that will be transmitted from a sensor device connected to the USB port. I would like to create a running chart that will display the data sequentially with respect to time.

[URL] ....

I am not sure how to implement the runLater function and display the data. What should I hope to accomplish using the ranLater function? I understand that I need to an XYChart.Series to keep a continuously modifying chart, but other than that I'm not sure how to implement it.

View Replies View Related

Pass Parameter To JavaFX Pie Chart

Jul 25, 2014

I have this class and I want to pass "pergunta" from another class:

Java Code:

here* = if I put a number, the code works. I want to receive the parameter "pergunta" here but I can't put a parameter in start .

I want to populate the array pergunta in a previous class and use in this one.

import javafx.application.Application;
import javafx.collections.FXCollections;
import javafx.collections.ObservableList;
import javafx.scene.Scene;
import javafx.stage.Stage;
import javafx.scene.chart.*;
import javafx.scene.Group;

[code]....

View Replies View Related

JavaFX 2.0 :: Horizontal Stacked Bar Chart

Sep 14, 2014

Using the sample, I tried to create a horizontal stacked bar chart, but it didn't render correctly.  Only a sliver of one bar shows and cosmetically the bar's rounded corners are at the top instead of the right side.
 
    @Override
    public void start(Stage primaryStage) {
        String austria = "Austria";
        String brazil = "Brazil";
        NumberAxis xAxis = new NumberAxis();
        xAxis.setLabel("Value");
        xAxis.setTickLabelRotation(90);

[Code] ....
 
Oddly, if I change the second series to this, then only one bar shows:
 
        series2.getData().add(new XYChart.Data(10, austria));
        series2.getData().add(new XYChart.Data(15, brazil));

View Replies View Related

JSF :: How To Save Chart Into JPEG Image When Using Primeface

Feb 26, 2014

<p:barChart id="category" value="#{machineReport.barChart}"
rendered="#{machineReport.isGraphical}" legendPosition="e"
title="Performance Chart" minY="0" maxY="40" minX="0" maxX="40"
xaxisLabel="Total Time" yaxisLabel="Total Pieces"
style="height:500px;width:700px;" />

[code] ....

View Replies View Related

JavaFX 2.0 :: Chart Axis Changing Color

Mar 20, 2015

I'm struggling to change the colour of the X and Y axis. I can change the colour of the ticks and the tick labels in CSS... But not the axis themselves.

View Replies View Related

JavaFX 2.0 :: Creating 4 Quadrants On Bubble Chart

Aug 17, 2014

I want to create 4 quadrants on a bubble chart. How can I do that. I have already created by bubble chart. The quadrant chart using JFreeChart is given here (Dave Gilbert's Weblog : Weblog) but I want to create it using JavaFX charting.

View Replies View Related

Monthly Temperature Chart Of Two Places - Array / While Loops

May 29, 2014

I started taking a java programming class javascript eclipse The program says it wants a monthly temperature chart of two places..Declare an array of values for Blueville temperatures and another array for Orlando temperatures. Then, use what you have learned to produce a program to output the following table:

Blueville Monthly temperatures

jan feb mar apr may jun jul aug sep oct nov dec

3 3 5 10 16 20 24 23 16 10 5 3

Orlando Monthly Temperatures

jan feb mar apr may jun jul aug sep oct nov dec

14 16 12 23 24 25 27 30 25 22 17 15

The warmest month in Blueville is _______

The warmest month in Orlando is ________

The month with the greatest temperature spread is __________

View Replies View Related

Swing/AWT/SWT :: Simple GUI Task - Draw Pie Chart With Different Colors

Jan 31, 2014

Simple gui task. it meant to draw pie chart with different colors. i can't seem to find a mistake in it. It works if i put in g2g.draw(arc) i know arcs overlaps a bit due int conversion, but that's ok.

import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.JTextField;
import java.awt.geom.Arc2D;
import java.awt.Graphics;
import java.awt.Graphics2D;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.Color;

[Code] ....

View Replies View Related

Scheduling Software - Display Chart Showing Lesson Times For Particular Teacher And Students

Aug 27, 2014

I want to develop a dynamic scheduling application that I hope to use at work, but I have some questions about the design approach since this is my first undertaking of this kind of project.

The purpose of the application is to display a chart showing the lesson times for a particular teacher and her students.

Here's are more important details:

-The chart displays the current day's schedule.
-The top row displays the teacher's name. There are at least 4 teachers each day.
-The leftmost column shows the times (from 3:00 to 8:00).
-The table is filled with the names of the students.

My current problem is deciding on the best approach to storing this data containing the teacher and her students and times. I should also note that there are about 500 students and around 20 teachers (i.e. the dataset is small). Is this a problem solved using a database and JDBC or could I just write the data to file? Are there other approaches that would solve this problem?

View Replies View Related

Store Pixels Values Currently On Screen And Compare Them To Values On The First Frame?

Aug 29, 2014

I need a way to store the pixels values currently on the screen and compare them to the values on the first frame. Right now I'm using glreadpixels as follows:

currentBuffer= BufferTools.reserveByteData(mapSize);
glReadPixels(mapStartX, mapStartY, mapWidth, mapHeight, GL_BLUE, GL_UNSIGNED_BYTE, currentBuffer);
for (int i = 0; i < mapSize; i++) {
if (currentBuffer.get(i) != baseBuffer.get(i)) {
//Do nothing
continue;
}
//Do something
}

This works perfectly fine but turns out to be a real bottleneck, dropping the fps to a third of what it was. Is there any quicker way? All I'm after is speed, I don't even need to show it on the screen if the comparison is made "behind the scene".

View Replies View Related

Servlets :: How To Send Multiple Values Of Same ID But Different Values Of HTML

Feb 27, 2015

I have a question in mind that this is my registration form. I am sending these values from HTML form to server and database. I have question that in my case if I click next to Add Another Mobile no in HTML.then a block is genereated and each time a new name is generated.

My Question is if I click 6 times then 6 name attribute are generated. How can I send and differentiate them on my server side.

Because at their I will use something request.getAttribute("Attr_Name");

But they are same. How to do this?.

View Replies View Related

Saving Number Of Chart In Array To New Array

Jan 15, 2014

just started programming in Java. My goal in this part of code was to read out the first array, while saving the number of the chart in the array to a new array.

first question: is the code clean and the method correct?

2nd question: i get an error when i try to print the newInt Array for no apparent reason.

Java Code:

public class viereinsdiezweite {
public static void main(String[] args){
int[] newInt = new int[20];
int specialInt = 3;
int[] bigInt = new int[]

[code]....

View Replies View Related

JSP :: Making Sessions To Not Expire?

May 30, 2006

how this is done using session.setMaxInactiveInterval(); at first, i did not set anything but it expires anyway.so i'm trying not to let the session expire.session.setMaxInactiveInterval(0) does not work.

View Replies View Related

Making Import / Export Of XML

Sep 17, 2014

I'm making an import/export of xml - I have the import of xml sorted I'm just trying to finish off the export. My export class is called XmlWriter.java. Inside the class I have an updateFile method to update an xml file as such:

public void updateFile(Environment environment,Document doc)
{
// code
}

I then in my main method have

public static void main(String argv[]){
 //declare new object of class
XmlWriter xmlWriter = new XmlWriter();
//test testUpdate method
// xmlWriter.testUpdate();
 Environment environment = ;

[code]....

I don't know what to make my variables equal to - eclipse keeps trying to use null but obviously that won't work. The Environment is another class that just contains getters and setters for the 3 different databases (that are in the xml file) and the getter/setter for the environment ID (also in xml file).

View Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved