Search found 492 matches

by John Matthews
Mon Jul 27, 2020 7:42 pm
Forum: JFreeChart
Topic: Returning the data displayed in the line chart current view
Replies: 1
Views: 156

Re: Returning the data displayed in the line chart current view

Examine the chart's XYPlot to learn the current range of the desired axis: Range domain = chart.getXYPlot().getDomainAxis().getRange(); Range range = chart.getXYPlot().getRangeAxis().getRange(); Use the range values to iterate over the dataset. DatasetUtils illustrates typical iteration schemes.
by John Matthews
Sat Apr 04, 2020 8:23 pm
Forum: JFreeChart
Topic: Time Series Chart - Date Axis Question
Replies: 4
Views: 2650

Re: Time Series Chart - Date Axis Question

Another alternative: add a suitable pattern to your SimpleDateFormat, perhaps D or E.
by John Matthews
Fri Apr 03, 2020 12:53 am
Forum: JFreeChart
Topic: Efficient way to update live graphs
Replies: 3
Views: 767

Re: Efficient way to update live graphs

The List<V> passed to process() affords you the opportunity to cache an arbitrary number of values of type V for a bulk update. Extending a suitable subclass of AbstractDataset will allow you to control when to notify listeners.
by John Matthews
Thu Apr 02, 2020 5:42 pm
Forum: JFreeChart
Topic: Efficient way to update live graphs
Replies: 3
Views: 767

Re: Efficient way to update live graphs

Update the chart's dataset in your implementation of SwingWorker::process , illustrated here . From the SwingWorker::publish API, "multiple invocations to the publish() method might occur before the process() method is executed. For performance purposes all these invocations are coalesced into one i...
by John Matthews
Wed Mar 18, 2020 12:15 am
Forum: JFreeChart
Topic: Time Series Chart - Date Axis Question
Replies: 4
Views: 2650

Re: Time Series Chart - Date Axis Question

One alternative: add a second domain axis with a different date format.
by John Matthews
Tue Nov 19, 2019 4:51 pm
Forum: JFreeChart
Topic: shift point
Replies: 1
Views: 1302

Re: shift point

You might try the example examined here. As version 1.0.13 dates to 2009, consider migrating to a more recent version.
by John Matthews
Mon Nov 18, 2019 11:35 am
Forum: JFreeChart
Topic: How to Apply Pattern to Bar Chart
Replies: 1
Views: 1268

Re: How to Apply Pattern to Bar Chart

As suggested here, you might look at returning a TexturePaint from your DrawingSupplier.
by John Matthews
Sun Nov 17, 2019 5:51 pm
Forum: JFreeChart
Topic: Chart Dimensions
Replies: 1
Views: 1276

Re: Chart Dimensions

In Swing, use a ChartPanel, a subclass of JPanel. Several size control approaches are examined here.
by John Matthews
Wed Oct 30, 2019 10:44 pm
Forum: JFreeChart
Topic: JFreeChart EDT Issues?
Replies: 2
Views: 2325

Re: JFreeChart EDT Issues?

ThreadCheckingRepaintManager can be very helpful, but it may not be dispositive. Other problems may exist. It's hard to say without a complete example and relevant version details. This example may provide a useful reference point from which to start trying to reproduce the effect you're seeing.
by John Matthews
Tue Aug 20, 2019 3:55 am
Forum: JFreeChart
Topic: Show majorAxis at the end of NumberAxis
Replies: 4
Views: 4739

Re: Show majorAxis at the end of NumberAxis

Also look at DatasetUtils methods that iterate over the items in an XYDataset to find the bounds.
by John Matthews
Fri Jul 12, 2019 4:38 am
Forum: JFreeChart
Topic: too many x axis values
Replies: 1
Views: 2859

Re: too many x axis values

Given a CategoryAxis, try setTickLabelsVisible or setCategoryLabelPositions with the desired position; alternatively, consider a SlidingCategoryDataset.
by John Matthews
Fri Jun 14, 2019 9:42 pm
Forum: JFreeChart
Topic: Access chart data with mouse click
Replies: 1
Views: 2782

Re: Access chart data with mouse click

It looks like you're working from the examples examined here . Your listener can use the series index or item number to index your label array: if (e.getEntity() instanceof XYItemEntity) { XYItemEntity i = (XYItemEntity) e.getEntity(); System.out.println(i.getSeriesIndex() + ":" + i.getItem()); } Al...