Home Discussion Discuss: Ask JavaFX Questions Online

  • Dynamic Stacked Bar ChartAnanth February 28, 2013 at 9:56 PM

    In the below example i have 3 series Region 1,2 & 3.. i want these series also to be dyanamic what ive done is used a mysql query using the DISTINCT CLAUSE got all the values of the attribute now depending on how many distinct values i have i ned that many Series. n then the values for these Series again needs an invocation of the Mysql query. public class StackedBarChartSmple extends Application { private void init(Stage primaryStage) { Group root = new Group(); primaryStage.setScene(new Scene(root)); String[] years = {"2007", "2008", "2009"}; CategoryAxis xAxis = CategoryAxisBuilder.create() .categories(FXCollections.<String>observableArrayList(years)).build(); NumberAxis yAxis = NumberAxisBuilder.create() .label("Units Sold") .lowerBound(0.0d) .upperBound(10000.0d) .tickUnit(1000.0d).build(); ObservableList<StackedBarChart.Series> barChartData = FXCollections.observableArrayList( new StackedBarChart.Series("Region 1", FXCollections.observableArrayList( new StackedBarChart.Data(years[0], 567d), new StackedBarChart.Data(years[1], 1292d), new StackedBarChart.Data(years[2], 1292d) )), new StackedBarChart.Series("Region 2", FXCollections.observableArrayList( new StackedBarChart.Data(years[0], 956), new StackedBarChart.Data(years[1], 1665), new StackedBarChart.Data(years[2], 2559) )), new StackedBarChart.Series("Region 3", FXCollections.observableArrayList( new StackedBarChart.Data(years[0], 1154), new StackedBarChart.Data(years[1], 1927), new StackedBarChart.Data(years[2], 2774) )) ); StackedBarChart chart = new StackedBarChart(xAxis, yAxis, barChartData, 25.0d); root.getChildren().add(chart); } @Override public void start(Stage primaryStage) throws Exception { init(primaryStage); primaryStage.show(); } public static void main(String[] args) { launch(args); } }

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
General

Ask JavaFX Questions Online
Ask JavaFX Questions Online       Ask programming questions related to the JavaFX development. Ask if you have query about JavaFX. With the help 

Vehicle Tracking Technology

JavaFX
JavaFX JavaFX  : New Paradigm in Rich Internet Applications... Microsystems announced JavaFX, a family of products based on Java technology to create Rich Internet applications (RIAs). JavaFX: Sun?s New Product Family 

Training

Instructor Led Training (ILT) on JavaFX at RoseIndia Technologies
an Online Training on the latest Java Technology JavaFX announced by Sun Microsystems... Instructor Led Training (ILT) on JavaFX at RoseIndia Technologies... on JavaFX you should introduce yourself with the new technology. Here 

General

Ask Programming Questions Online
Ask Programming Questions Online   ..., SOA questions, Hibernate questions, Struts questions, JavaFX questions.... So, feel free and post Java questions, JSP questions, Servlet questions, EJB 

Vehicle Tracking Technology

JavaFX Scripting Language
JavaFX Scripting Language       II. JavaFX Scripting Language JavaFX Script... authors. In layman style - JavaFX lets you enjoy a consistence user experience 

Software Services

JavaFX
JavaFX       JavaFX 3D Effect Example We can create an Object in JavaFX and can give him 3D Effect (like Creating Sphere with Circle and 3D text 

Java Magazine Questions

javaFx technology
javaFx technology   how to call a Form to another Form in javaFx programme and need a proper professional guide with example for javaFx technology plz send as soon as possible 

Java Beginners

online quiz
online quiz  Define a Question class which stores a multiple choice... of up to 10 questions. Define the add method of the Quiz class to add a question... approach to populates a quiz, presents it by asking questions randomly 

Java Magazine Questions

online quiz
online quiz  Define a Question class which stores a multiple choice... of up to 10 questions. Define the add method of the Quiz class to add a question... approach to populates a quiz, presents it by asking questions randomly 

Design concepts & design patterns Questions

online quiz
online quiz  Define a Question class which stores a multiple choice... of up to 10 questions. Define the add method of the Quiz class to add a question... approach to populates a quiz, presents it by asking questions randomly 

Java Beginners

online quiz
online quiz  Define a Question class which stores a multiple choice... of up to 10 questions. Define the add method of the Quiz class to add a question... approach to populates a quiz, presents it by asking questions randomly 

Java Interview Questions

online quiz
online quiz  Define a Question class which stores a multiple choice... of up to 10 questions. Define the add method of the Quiz class to add a question... approach to populates a quiz, presents it by asking questions randomly 

Java Beginners

online quiz
online quiz  Define a Question class which stores a multiple choice... of up to 10 questions. Define the add method of the Quiz class to add a question... approach to populates a quiz, presents it by asking questions randomly 

Java Beginners

JavaFX deployment in Jboss
JavaFX deployment in Jboss  Hi, How to deploy javafx application into JBoss 

WebSevices Questions

online exam portal
online exam portal  i am thinking of developing a small online exam pattern with multipe choice questions , can u please give me any idea of how to start 

Java Beginners

set background image in javafx
set background image in javafx  Hi, How to add backgroung image in javafx integrated with jswing 

JSP Servlet Questions

Online performance system
Online performance system  hi m developing Online performance... be created by the system , by automatically selecting the questions from database... an online test thanks vinoy 

General

JavaFX
 

JSP Servlet Questions

jsp online exam
jsp online exam  i have designed a html page with 20 multiple choice questions ...options are in radio button for each question .... now i have to retrieve all the selected answers and save it to database match it with correct 

Programming Tutorials

JavaFX
JavaFX      ...;  Emergence of JavaFX   JavaFX began as a project by Chris Oliver... making GUI programming easier in general.   JavaFX Mobile 

Java3D Questions

JavaFX issue - Java3D
JavaFX issue  Hi all, I developed a widget in JavaFX using Netbeans6.1. I added the following line to disable the background frame view fill: null fill:Color.TRANSPARENT } visible: true windowStyle 

JSP Servlet Questions

online examination system project in jsp
online examination system project in jsp  thanks for providing me 6 tables for online examination system. I want to know what will the id field of Answers1 table contain? Will it contain same id for all the questions of Set1 & 

JSP Servlet Questions

online examination system project in jsp
online examination system project in jsp  thanks for providing me 6 tables for online examination system. I want to know what will the id field of Answers1 table contain? Will it contain same id for all the questions of Set1 & 

JavaScript Questions

JAVASCRIPT FOR ONLINE QUIZ
JAVASCRIPT FOR ONLINE QUIZ  i m creating a set of online questionnaire consist of 12 questions with choice of answers from 0-6.i've done creating... want to use get element by id function to read the score.if any questions 

EJB Questions

Online Examination System
Online Examination System  Hi.. I have to create a Online Examination system using struts, Hibernate and stateful session beans.. I Wanna know... to add/edit/delete questions and users. System should be able to provide proper 

Free Magazine

JavaFX
JavaFX                 New Paradigm in Rich....        Emergence of JavaFX  JavaFX 

Programming Questions

Software Questions and Answers
; View Software Questions and Answers online Discuss Software development questions, ask your questions and get answers online. Here you can... programming problems. Ask Questions | Browse Latest Questions 

General

Ask Java Questions Online
Ask Java Questions Online   ... is everywhere! View and ask questions at http... Developer Company has just begun a new service ‘ask question online&rsquo 

JSP Servlet Questions

online examination system project in jsp
online examination system project in jsp  Thanks for providing me the 6 tables.But I want to know will the id field of answers1 table be same for all questions of Set1? Will it be 1 or will be 1,2,3,... What 

Java Beginners

online test application in java
online test application in java  Can questions come in html file (test.html) if we link test.jsp with test.html   We have taken... the following link: http://www.roseindia.net/jsp/online-quiz-application-jsp.shtml 

DMCA.com