Why are not all the Bars in my Barchart red?
Why are not all the Bars in my Barchart red?
Hi there,
Somehow i am getting some white Bars into my Histogram, any idea why?
http://www.directupload.net/file/d/3811 ... xf_png.htm
int number = 155897;//max number of Pixels
HistogramDataset dataset = new HistogramDataset(); //create a Histogram
dataset.setType(HistogramType.RELATIVE_FREQUENCY);
dataset.addSeries("Histogram",doubleArray,number);
String plotTitle = "Histogram";
String xaxis = "pixel";
String yaxis = "intensity";
PlotOrientation orientation = PlotOrientation.VERTICAL;//sets the vertical orientation of the Histogram
boolean show = false;
boolean toolTips = false;
boolean urls = false;
JFreeChart chart = ChartFactory.createHistogram( plotTitle, xaxis, yaxis,
dataset, orientation, show, toolTips, urls);
int widthg = 500;
int heightg = 300;
try {
ChartUtilities.saveChartAsPNG(new File("histogram41.PNG"), chart, widthg, heightg);//converted the Histogram to image foramt(PNG) and saves it in your workspace
} catch (IOException e) {}
}}
Somehow i am getting some white Bars into my Histogram, any idea why?
http://www.directupload.net/file/d/3811 ... xf_png.htm
int number = 155897;//max number of Pixels
HistogramDataset dataset = new HistogramDataset(); //create a Histogram
dataset.setType(HistogramType.RELATIVE_FREQUENCY);
dataset.addSeries("Histogram",doubleArray,number);
String plotTitle = "Histogram";
String xaxis = "pixel";
String yaxis = "intensity";
PlotOrientation orientation = PlotOrientation.VERTICAL;//sets the vertical orientation of the Histogram
boolean show = false;
boolean toolTips = false;
boolean urls = false;
JFreeChart chart = ChartFactory.createHistogram( plotTitle, xaxis, yaxis,
dataset, orientation, show, toolTips, urls);
int widthg = 500;
int heightg = 300;
try {
ChartUtilities.saveChartAsPNG(new File("histogram41.PNG"), chart, widthg, heightg);//converted the Histogram to image foramt(PNG) and saves it in your workspace
} catch (IOException e) {}
}}
Re: Why are not all the Bars in my Barchart red?
Is it really no one out there, that can tell me why???
Re: Why are not all the Bars in my Barchart red?
To me this seems like a rendering artifact. The bars are quite small on the image. Did you try enlarging the chart?
hth,
- martin
hth,
- martin
Re: Why are not all the Bars in my Barchart red?
now i zoomed it and actually most of the bars are like 2- or 3-coloured.
some are redwhite some are red and hellred and all i do want is just all of them to be just standard RED
some are redwhite some are red and hellred and all i do want is just all of them to be just standard RED
Re: Why are not all the Bars in my Barchart red?
How did you zoom? Zoom the generated PNG?
You should create a PNG with higher resolution or zoom in your application.
You should create a PNG with higher resolution or zoom in your application.
Re: Why are not all the Bars in my Barchart red?
http://www.ayukucode.org/wp-content/upl ... xample.jpg
why is there a thin white line at the left side of evry bar, i need the bar to have only one colour
why is there a thin white line at the left side of evry bar, i need the bar to have only one colour
Re: Why are not all the Bars in my Barchart red?
Ha, just what I thought!
That's eyecandy Try this:
hth,
- martin
That's eyecandy Try this:
Code: Select all
ChartFactory.setChartTheme(StandardChartTheme.createLegacyTheme());
- martin
Re: Why are not all the Bars in my Barchart red?
Thanks a lot
I tried that, but now i need to find out how to turn off the shadows of the bars that are been showed.
I tried that, but now i need to find out how to turn off the shadows of the bars that are been showed.
Re: Why are not all the Bars in my Barchart red?
BarRenderer.setDefaultShadowsVisible(false)
Or the corresponding method if you are using a different renderer.
hth,
- martin
Or the corresponding method if you are using a different renderer.
hth,
- martin