Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
 All Forums
 Tools for Java
 QCChart2D for Java
 Setting the x-axis items at the bottom...

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkInsert EmailInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
   

T O P I C    R E V I E W
javaman Posted - 14 May 2009 : 14:11:02
Hi,

Right now, I have a time series plot (Y value ranges from 0 to 10000 and X is the time value). So, the x-axis displays the time value at certain intervals. Is it possible to set what the x-axis displays? Right now, the x-axis displays a HH:MM:SS format. I'd like to change that to display the day of year such that is becomes DDD/HH:MM:SS. Is this possible - how can I do this?

Here's my code:

xAxis1 = new TimeAxis(pTransform1);
xAxis1.setColor(Color.white);
gWG.addChartObject(xAxis1);

yAxis1 = new LinearAxis(pTransform1, ChartConstants.Y_AXIS);
yAxis1.setColor(Color.white);
gWG.addChartObject(yAxis1);

xAxisLab1 = new TimeAxisLabels(xAxis1);
xAxisLab1.setColor(Color.white);
gWG.addChartObject(xAxisLab1);

Thanx - Joe!
2   L A T E S T    R E P L I E S    (Newest First)
javaman Posted - 26 May 2009 : 19:48:53
Thank you! That worked beautifully!
Joe...

Thanx - Joe!
quinncurtis Posted - 14 May 2009 : 16:38:50
You can customize the TimeAxisLabels format following the rules of the Java SimpleDateFormat class.

Use the string you show with the setCustomTimeFormatString method. The example below also turns off the date crossover, which you probably don't want.

TimeAxisLabels xAxisLab = new TimeAxisLabels(xAxis);
xAxisLab.setTextFont(theFont);
xAxisLab.setCustomTimeFormatString("DDD/HH:mm");
xAxisLab.setDateCrossoverMode(ChartObj.NO_DATECROSSOVER);

Quinn-Curtis Forums © 2000-2018 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07