legend « Series « JFreeChart Q&A





3. Refresh legend after changing series color?    jfree.org

I wrote a cewolf ChartPostProcessor to modify the color of the series in a chart rather than using the default ones. Changing the actual series colors was easy, but I don't see a quick way to get the legend to refresh the color boxes next to the LegendItems with the new colors. The LegendItems themselves (retrieved via the plot.getLegendItems()) are immutable, ...

4. Click on Legend To Hide Series    jfree.org

You can add a ChartMouseListener to the ChartPanel and look out for LegendItemEntities. If you have the JFreeChart Developer Guide (and thus the demo source code), check out MouseListenerDemo3.java. From there, you can hide a series either by physically removing it from the dataset, or setting the visibility flag in the renderer (not all renderers support this yet).

5. removing series legends from an overlaid chart    jfree.org

Hi, I have stackedBar chart with custom colors and a line chart overlaid on top of it. I would like to remove legends for the stacked bar graph and display only legends for lline chart. I am using StackedBarRenderer and LineAndShapeRenderer. I tried different combinations of setting visibilityof series to false on StackedBarRenderer, but it seems to ignore it. for ex: ...

6. Legend Display OFF - caused series color change    jfree.org

All: It seems as though the series colors change ordering depending on whether or not I include legends when calling the following methods: ChartFactory.createHistogram ChartFactory.createScatterPlot If I call those methods with display legend set to true then the series are red then blue (for a 2 series graph). If I call it with legends set to false, then it is blue ...

7. Change the position of the series names in legend    jfree.org

Hi, I have a chartpanel which has 5 JfreeCharts inside. Every chart has 2 series. Which is the best and easiest solution to show the labels in the legend in this way? Series1Chart1 Series1Chart2 Series1Chart3 Series1Chart4 Series1Chart5 Series2Chart1 Series2Chart2 Series2Chart3 Series2Chart4 Series2Chart5 it will be better if someone can provide also a snippet.

8. [Solved] Legend does not show series colors in StackedBar...    jfree.org

Hi everyone, I'm having a problem with the legend of my StackedBarChart. I'm assigning several GradientPaints to the series of the graph, but these colors do not show up in the legend. Threre, every series is white. This is what I do (i am customizing the chart generated by JasperReports): Code: Select all // get the renderer StackedBarRenderer renderer = (StackedBarRenderer) ...





10. TimeSeries legend    jfree.org

Hi everyone : I want to add timeseries into a timseriescollection dynamicly, and following is my code: public void addSeries(PerformanceData pmdata) { int i = timeseriesmap.size() + 1; final TimeSeries series1 = new TimeSeries( pmdata.getPeerName(),org.jfree.data.time.Millisecond.class); timeseriescollection.addSeries(series1); xyplot.setDataset(i, timeseriescollection); xyplot.setRenderer(i, new DefaultXYItemRenderer()); xyplot.mapDatasetToRangeAxis(i, 1); timeseriesmap.put(pmdata.getPeerName(), series1); addValue(pmdata); System.err.println("the series num is " + timeseriesmap.size()); } The class PerformanceData is the class that ...