Jump to content
Software FX Community
Shady

Problem with setCustomFormat

Recommended Posts

Hi,

I am having a problem with the setCustomFormat method found in ValueFormat. In fact I tried the pattern given in the doc: "For example, you can use the format string "##0,," to represent 100 million as 100. Numbers smaller than 1 million are displayed as 0", however it is generating an error. Could someone please tell me what I am doing wrong?

Here is the code I am testing:

public static void main(String[] args) {   com.softwarefx.chartfx.desktop.Chart chart1 = new com.softwarefx.chartfx.desktop.Chart();   chart1.getToolBar().setVisible(true);   chart1.getAxisY().getLabelsFormat().setCustomFormat("##0,,");   for(int x = 0; x < 10; x++) {   chart1.getData().set(0, x, x * 1000000);   }   JFrame f = new JFrame();   f.getContentPane().add(chart1);   f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);   f.setSize(new Dimension(1500, 1000));   f.setVisible(true);   }

 And here is the error I am getting:

 Exception in thread "main" java.lang.IllegalArgumentException: Multiple decimal separators in pattern "##0,,"   at java.text.DecimalFormat.applyPattern(DecimalFormat.java:2520)   at java.text.DecimalFormat.applyLocalizedPattern(DecimalFormat.java:2312)   at com.softwarefx.sfxnet.System.Double.b(SourceFile:162)   at com.softwarefx.chartfx.desktop.internal.ValueFormat.a(SourceFile:278)   at com.softwarefx.chartfx.desktop.internal.ValueFormat.v(SourceFile:352)   at com.softwarefx.chartfx.desktop.internal.Axis.a(SourceFile:2014)   at com.softwarefx.chartfx.desktop.internal.Axis.a(SourceFile:2029)   at com.softwarefx.chartfx.desktop.internal.Axis.a(SourceFile:1995)   at com.softwarefx.chartfx.desktop.internal.Axis.a(SourceFile:2191)   at com.softwarefx.chartfx.desktop.internal.Axis.a(SourceFile:1967)   at com.softwarefx.chartfx.desktop.internal.Axis.a(SourceFile:1945)   at com.softwarefx.chartfx.desktop.internal.AxisCollection.a(SourceFile:54)   at com.softwarefx.chartfx.desktop.internal.Pane.a(SourceFile:287)   at com.softwarefx.chartfx.desktop.internal.PaneCollection.a(SourceFile:94)   at com.softwarefx.chartfx.desktop.internal.ScaleInfo.g(SourceFile:674)   at com.softwarefx.chartfx.desktop.internal.ScaleInfo.a(SourceFile:793)   at com.softwarefx.chartfx.desktop.internal.Chart.a(SourceFile:3427)   at com.softwarefx.chartfx.desktop.internal.u.a(SourceFile:793)   at com.softwarefx.chartfx.desktop.internal.u.a(SourceFile:438)   at com.softwarefx.chartfx.desktop.internal.Internal.DockableFrameCore.a(SourceFile:211)   at com.softwarefx.chartfx.desktop.internal.Internal.DockableFrameCore.a(SourceFile:141)   at com.softwarefx.chartfx.desktop.internal.Chart.e(SourceFile:4387)   at com.softwarefx.chartfx.desktop.internal.Chart.l(SourceFile:4213)   at com.softwarefx.sfxnet.internal.df$h.propertyChange(SourceFile:1217)   at com.softwarefx.chartfx.desktop.Chart.setVisible(SourceFile:2052)   at com.softwarefx.chartfx.desktop.Chart.doLayout(SourceFile:2071)   at java.awt.Container.validateTree(Container.java:1519)   at java.awt.Container.validateTree(Container.java:1526)   at java.awt.Container.validateTree(Container.java:1526)   at java.awt.Container.validateTree(Container.java:1526)   at java.awt.Container.validateTree(Container.java:1526)   at java.awt.Container.validate(Container.java:1491)   at java.awt.Window.show(Window.java:825)   at java.awt.Component.show(Component.java:1422)   at java.awt.Component.setVisible(Component.java:1375)   at java.awt.Window.setVisible(Window.java:806)

Many thanks in advance

Shady

Share this post


Link to post
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.

Loading...

×
×
  • Create New...