Jump to content
Software FX Community

NoClassDefFoundError: SoftwareFX/ChartFX/Map/DefaultAttributes


fabricator

Recommended Posts

Hi,

I am getting an exception while generating graph using ChartFx6.5 for java,

 

Exception in thread "main"
java.lang.NoClassDefFoundError: SoftwareFX/ChartFX/Map/DefaultAttributes

  at
SoftwareFX.ChartFX.PointAttributesCollection.getItem(Unknown Source)

  at SoftwareFX.ChartFX.ChartCore.getPoint(Unknown Source)

  at com.sample.TrialGraph.main(TrialGraph.java:25)

Jars I'm using are,

  • chartfx.jar
  • chartfx.designer.jar 

and here is my code, 

 
public class TrialGraph {

 public static void main(String a[]) throws Exception {

 Chart chart = new Chart();
    try {
     
      chart.setGallery(Gallery.PIE);
      chart.setChart3D(false);
      chart.openData(COD.VALUES, 1, 2);
      chart.getValue().setItem(0, 0, 10000);
      chart.getValue().setItem(0, 1, 20000);
      chart.closeData(COD.VALUES);
     
      chart.setPointLabels(true);
      chart.setPointLabelMask("%l");
      chart.setScheme(Scheme.SOLID);
      chart.getLegend().setItem(0, "Payment");
      chart.getLegend().setItem(1, "Sample");
      //chart.getPoint().getItem(0, 0).setColor(new Color(255, 228, 78));
      chart.getPoint(0,1).setColor(Color.CYAN);

     
      chart.setImgQuality(100);
      chart.setPointLabelColor(Color.BLACK);
      chart.setPointLabelFont(new Font("Arial", Font.PLAIN, 7));
      chart.setPointLabelAlign(LabelAlign.CENTER);
     
      chart.setHeight(330);
      chart.setWidth(450);
      chart.getSeries(0).setColor(Color.BLACK);
      chart.getSeries(1).setColor(Color.BLACK);
      chart.getSeries(2).setColor(Color.BLACK);
      chart.getSeries(3).setColor(Color.BLACK);
      chart.setBorder(false);
      chart.setDirty(false);
      chart.setGaps(new Rectangle(1, 1, 1, 1));
      chart.setBackColor(Color.WHITE);
     
      //Setting the title
      Title title = chart.getTitle(0);
      title.setFont(new Font("Arial", Font.BOLD, 14));
      title.setText("Test graph");
      title.setTextColor(Color.BLACK);
      title.setDrawingArea(false);
     
      Pie pie = (Pie) chart.getGalleryObj();
      pie.setShadows(true);
      pie.setLabelsInside(false);
      pie.setShowLines(true);
           
      chart.exportChart(FileFormat.PNG, "D:\\outputs\\PieChart.png");
    } catch (IOException e) {
      e.printStackTrace();
    }

 } 

 

Thanks in advance for support.
 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...