0

I created a graph of xy line chart by this code:

JFreeChart chart = ChartFactory.createXYLineChart(
        "", // chart title
        "Viscosity @25 C°", // x axis label
        "Tg C°", // y axis label
        dataset, // data
        PlotOrientation.VERTICAL,
        true, // include legend
        true, // tooltips
        false // urls
);

Now after I created it, I want to change the type to SpiderWebPlot. How to do this?

I tried to create in chart variable the spiderWebPlot, but it din't work.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045
user165210
  • 292
  • 4
  • 18

1 Answers1

1

Enclose your JFreeChart in a ChartPanel and invoke setChart() to replace the chart in the panel as the need arises. Complete examples are shown here and here. To change the chart panel's initial size, override getPreferredSize() as shown here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045