Hi, right now I have created an XYBarChart using a TimePeriodValuesCollection. My data is spaced out quite a bit since the time between data is large. Sometimes this results in a chart that has very small, almost indistinguishable, bars.
My thought is to do away with the time aspect of the data.
What I want is a bar chart, or histogram, where the width of the bar is based upon a time period. What I can't figure out is which class I need to use to hold my translated TimePeriodValuesCollection.
Is an XYBarDataset wrapped around an XYIntervalSeriesCollection the right place to start looking?
Create barchart from a TimePeriodValuesCollection
-
- Posts: 14
- Joined: Thu Mar 02, 2006 9:00 pm
-
- Posts: 14
- Joined: Thu Mar 02, 2006 9:00 pm
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Returned from where?JoshRountree wrote:Anyone know why a NumberAxis is returned for a dataset of type TimePeriodValuesCollection?
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader


-
- Posts: 14
- Joined: Thu Mar 02, 2006 9:00 pm
If I create a TimePeriodValuesCollection and use it in the ChartFactory.createXYBarChart method to create a chart, I recieve a NumberAxis object returned from the getDomainAxis() method of the Plot class recieved from the created Chart object.
Am I doing something wrong. I have the JFreeChart manual and demo program. In your manual you mention being able to do this and have source to do this, but it isn't in the demo.
Also the source that does this creates an XYItemRenderer, DateAxis, and XYPlot manually, then creates the chart without the chart factory methods.
This way works and was my work around.
Am I doing something wrong. I have the JFreeChart manual and demo program. In your manual you mention being able to do this and have source to do this, but it isn't in the demo.
Also the source that does this creates an XYItemRenderer, DateAxis, and XYPlot manually, then creates the chart without the chart factory methods.
This way works and was my work around.
What value are you passing for the third argument?
Code: Select all
1260 * @param dateAxis make the domain axis display dates?
1271 public static JFreeChart createXYBarChart(String title,
1272 String xAxisLabel,
1273 boolean dateAxis,
1274 String yAxisLabel,
1275 IntervalXYDataset dataset,
1276 PlotOrientation orientation,
1277 boolean legend,
1278 boolean tooltips,
1279 boolean urls) {
-
- Posts: 14
- Joined: Thu Mar 02, 2006 9:00 pm
skunk wrote:What value are you passing for the third argument?Code: Select all
1260 * @param dateAxis make the domain axis display dates? 1271 public static JFreeChart createXYBarChart(String title, 1272 String xAxisLabel, 1273 boolean dateAxis, 1274 String yAxisLabel, 1275 IntervalXYDataset dataset, 1276 PlotOrientation orientation, 1277 boolean legend, 1278 boolean tooltips, 1279 boolean urls) {
Wow, I'm an idiot...
Thanks for the help!