Search found 1087 matches

by skunk
Mon Nov 15, 2010 10:02 pm
Forum: JFreeChart
Topic: Hiding Itemlabels with a value of zero
Replies: 2
Views: 3497

Re: Hiding Itemlabels with a value of zero

Have you tried something like this yet? chart.getCategoryPlot().setRenderer(new BarRenderer() { public boolean isItemLabelVisible(int row, int column) { double value = getPlot().getDataset().getValue(row, column); if (value == 0) return false; return super.isItemLabelVisible(row, column); } });
by skunk
Mon Nov 15, 2010 7:23 pm
Forum: JFreeChart
Topic: Creating a Stacked Area and Bar Combination
Replies: 2
Views: 3153

Re: Creating a Stacked Area and Bar Combination

1. Create your stacked area chart 2. Add the dataset for your second plot using chart.getCategoryPlot().setDataset(1, ds2); 3. Add a renderer for the second plot using chart.getCategoryPlot().setRenderer(1, new BarRenderer()); 4. Tell the plot to render the second dataset "above" the first chart.get...
by skunk
Mon Nov 15, 2010 5:53 pm
Forum: JFreeChart
Topic: Stop axis width changing (lining up graphs)
Replies: 4
Views: 4116

Re: Stop axis width changing (lining up graphs)

Use a CombinedDomainXYPlot (or CombinedDomainCategoryPlot, depending on what type of plots you are using) instead.

Your other methods are fraught with problems, expecially if the fonts used to display the axis/tick labels are not monospaced
by skunk
Sun Nov 14, 2010 3:28 pm
Forum: JFreeChart - Stockmarket
Topic: Remove shadow offset on Bar Charts?
Replies: 2
Views: 13939

Re: Remove shadow offset on Bar Charts?

2. Call the following before creating any chart objects XYBarRenderer.setDefaultBarPainter(new StandardXYBarPainter() { @Override public void paintBarShadow(Graphics2D g2, XYBarRenderer renderer, int row, int column, RectangularShape bar, RectangleEdge base, boolean pegShadow) {} }); Modify as requi...
by skunk
Fri Nov 12, 2010 12:38 am
Forum: JFreeChart
Topic: iterateToFindDomainBounds using series -1
Replies: 1
Views: 2246

Re: iterateToFindDomainBounds using series -1

Did you try simplifying your implementation of getSeriesKey to something like this?

Code: Select all

public Comparable getSeriesKey( final int xSeries ){
    return getSeriesName( xSeries );
}
Also, consider changing DomainOrder.ASCENDING to DomainOrder.NONE
by skunk
Fri Nov 12, 2010 12:28 am
Forum: JFreeChart
Topic: Auto adjust ValueAxis max and min range values
Replies: 2
Views: 4100

Re: Auto adjust ValueAxis max and min range values

Code: Select all

public void setAutoRangeIncludesZero(boolean flag)
by skunk
Mon Nov 08, 2010 2:52 pm
Forum: JFreeChart
Topic: TimeSeries with seconds
Replies: 2
Views: 2909

Re: TimeSeries with seconds

Did you try using this constructor

Code: Select all

public TimeSeries(java.lang.Comparable name, java.lang.Class timePeriodClass)
with a value of org.jfree.data.time.Second for the timePeriodClass argument?
by skunk
Sat Nov 06, 2010 7:37 pm
Forum: JFreeChart
Topic: Having trouble making a histogram
Replies: 1
Views: 3231

Re: Having trouble making a histogram

I have two main problems. One is that the data is shifted one value to the right. In other words the bar reaching to 2.00 should be over the "3", not over the "4" (you can see my data values in the createHistogramDataset method pasted below). The other problem is that the values for 9 and 10 are be...
by skunk
Thu Nov 04, 2010 1:35 pm
Forum: JFreeChart
Topic: Axis Range
Replies: 9
Views: 7779

Re: Axis Range

Your data contains values between 1 and 8.

What do you expect the plot to look like if you set the tick unit to 10?
by skunk
Wed Nov 03, 2010 7:46 pm
Forum: JFreeChart
Topic: Axis Range
Replies: 9
Views: 7779

Re: Axis Range

I'm not sure how your data is specified. if your data is 0.1 = 10% then try a tick unit of 0.1
by skunk
Wed Nov 03, 2010 6:47 pm
Forum: JFreeChart
Topic: Axis Range
Replies: 9
Views: 7779

Re: Axis Range

If you specify 10 then each tick will be 10 units apart ie 0,10,20,30
If you specify 20 then each tick will be 20 units apart ie 0,20,40,60
etc
by skunk
Wed Nov 03, 2010 5:42 pm
Forum: JFreeChart
Topic: Axis Range
Replies: 9
Views: 7779

Re: Axis Range

org.jfree.chart.axis.NumberAxis defines these methods

Code: Select all

public void setNumberFormatOverride(java.text.NumberFormat formatter)
public void setTickUnit(NumberTickUnit unit)
by skunk
Mon Nov 01, 2010 4:45 pm
Forum: JFreeChart - Stockmarket
Topic: Displaying range axis tick labels in millions
Replies: 2
Views: 9885

Re: Displaying range axis tick labels in millions

You could try something like this: rangeAxis.setNumberFormatOverride(new DecimalFormat() { public StringBuffer format(double number, StringBuffer toAppendTo, FieldPosition pos) { if (number >= 1000000) { toAppendTo.append((int)(number / 1000000)); toAppendTo.append("m"); } else if (number >= 1000) {...
by skunk
Fri Oct 29, 2010 7:57 pm
Forum: JFreeChart
Topic: shared x and y axes
Replies: 1
Views: 2277

Re: shared x and y axes

As far as I'm aware this is not supported.