label only selected categories?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
fantasy_fee
Posts: 1
Joined: Wed Aug 30, 2006 3:53 pm

label only selected categories?

Post by fantasy_fee » Wed Aug 30, 2006 4:04 pm

Hello,

i am using a [i]DefaultCategoryDataset[/i] to store my data (y-Axis is a double, x-Axis a String) and [i]ChartFactory.createLineChart[/i] to create the chart.

My problem is, that i only want labels on certain ticks of the x-Axis (only categories that have a high value). Is there any provision for this? I tried to look through the source for CategoryAxis but could not really find anything.

Regards, Fee

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Aug 31, 2006 11:18 am

You'll need to subclass the CategoryAxis class and override the refreshTicks() method.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

albamati
Posts: 7
Joined: Thu Jul 13, 2006 3:40 pm

Similar problem, but easier (I hope)

Post by albamati » Mon Sep 04, 2006 11:58 am

I have a CategoryAxis. I want to show just 1 out of 10 label, beacuse I have more that 100 labels. I tried to put "" as label, but the resulting graph is not correct.

Thanx
alb

Locked