Visibel of CategoryItemRenderer

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Guest, Lu

Visibel of CategoryItemRenderer

Post by Guest, Lu » Tue Feb 22, 2005 11:19 am

Hello,

I try to make a Line from a LineAndShapeRenderer visible or unvisible
(depending on a checkbox).

I searched the Forum and see, that this is a new Feature (setSeriesVisible) and not updated yet for the CategoryItemrenderer (I use Version 0.9.21).

But the LineAndShapeRenderer implements this Method.
Unfortunately it does not work!

Code: Select all

LineAndShapeRenderer renderer = (LineAndShapeRenderer)plot.getRenderer(0);

renderer.setSeriesVisible(series, new Boolean(false));
It is may mistake?? And if not is there another simple way to hide a Line from a LineAndShapeRenderer? Or is the update Online next Time?

Thanks for any help

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 » Tue Feb 22, 2005 6:55 pm

The series visibility infrastructure is being inherited from the AbstractRenderer class but it hasn't been implemented by many renderers at this point. It will be done for the main renderers fairly soon.
David Gilbert
JFreeChart Project Leader

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

jesse
Posts: 8
Joined: Fri Nov 17, 2006 7:16 pm

Still True?

Post by jesse » Fri Nov 17, 2006 7:18 pm

I tried this again today and it didn't work. Is it still true that CategoryItemRenderer.setSeriesVisible() is not implemented?

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Post by skunk » Fri Nov 17, 2006 8:59 pm

CategoryItemRenderer is an interface.

What renderer are you using?

jesse
Posts: 8
Joined: Fri Nov 17, 2006 7:16 pm

Post by jesse » Fri Nov 17, 2006 9:03 pm

I am using ChartFactory.createBarChart to create a bar chart and chart.getCategoryPlot().getRenderer(); to get the Renderer. The bar renderer is org.jfree.chart.renderer.category.BarRenderer.

Thanks.

jesse
Posts: 8
Joined: Fri Nov 17, 2006 7:16 pm

Post by jesse » Wed Nov 29, 2006 8:13 pm

Does anyone have any idea on this?

In addition to the BarChart, I am trying to hide a series in StackedBarChart.

Code: Select all

JFreeChart chart = ChartFactory.createStackedBarChart( "", // chart
				// title
				"Workspace", // domain axis label
				"TB", // range axis label
				createDiskspaceDataset(), // data
				PlotOrientation.HORIZONTAL, true, // include legend
				true, // tooltips?
				false // URLs?
				);
		chart.setBackgroundPaint( null );

		CategoryPlot plot = chart.getCategoryPlot();
		StackedBarRenderer renderer = (StackedBarRenderer) plot.getRenderer();

renderer.setSeriesVisible( 0, false );
Thanks.

Locked