Cannot see "visible" lines!!!

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Birgi
Posts: 21
Joined: Mon Mar 14, 2005 9:09 pm

Cannot see "visible" lines!!!

Post by Birgi » Thu Mar 24, 2005 4:58 pm

Hi,

In my chart I can see all the data points, but I cannot see the lines. "isLinesVisible()" method returns "true". However I have the following chart, maybe an image would help;

Image

and my code for this chart is;

Code: Select all

		chart = ChartFactory.createBarChart(
											 criteria + " Grafiği",		// chart title
											 "Ürünler", 				// domain axis label
											 criteria, 					// range axis label
											 dataset, 					// data
											 PlotOrientation.VERTICAL, 
											 false, 					// include legend
											 true,						// tooltips?
											 false						// URLS?
											);
		chart.setBackgroundPaint(Color.lightGray);
		// creating the secondary chart & secondary axis

		CategoryPlot plot = chart.getCategoryPlot();
		NumberAxis axis2 = new NumberAxis("Satış Yüzdesi");
		plot.setRangeAxis(1, axis2);
		plot.setDataset(1, secondaryDataset);
		LineAndShapeRenderer lineRenderer = new LineAndShapeRenderer(true,true);
		plot.setRenderer(1, lineRenderer);
		plot.mapDatasetToRangeAxis(1, 1);
		plot.setDatasetRenderingOrder(DatasetRenderingOrder.FORWARD);
I desperately need help!!!
Thanks a lot

Birgi

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 Mar 24, 2005 5:17 pm

You need to look at how your dataset is constructed, because you don't have one series containing many data points, you have many series each containing one data point.
David Gilbert
JFreeChart Project Leader

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

Birgi
Posts: 21
Joined: Mon Mar 14, 2005 9:09 pm

Post by Birgi » Thu Mar 24, 2005 6:12 pm

David,

Code: Select all

for(;;)
    System.out.println("Thank you very much!");
Thanks a lot :D

Birgi

Sarika

Post by Sarika » Fri Mar 25, 2005 2:28 pm

why don't u check in lineandshaperenderer for method
which allows u to show shapes / lines/both at same time

i think there is method to do this

Birgi
Posts: 21
Joined: Mon Mar 14, 2005 9:09 pm

Post by Birgi » Fri Mar 25, 2005 4:47 pm

Sarika,

As David mentioned my problem was about my secondary dataset. I think I put every element in a different category. That was why they were not any lines between the data point. Now my graph is just as I wanted.

Thanks for your concern

Birgi

Locked