Jump to content
JChartFX Community
  • 0

SetFormat - SetCustomFormat - adding °C



1 answer to this question

Recommended Posts

  • 0

setCustomFormat is currently not supported. To get the chart to display degrees you can set the Axis to be currency and change the currency symbol so that it matches what you need. Unfortunately in current builds you have to replace all the currency settings so you will need code like this


chart1.setCulture({ "shortDate": "M/dd/yyyy",

                 "longDate": "dddd, MMMM dd, yyyy",

                 "dateTime": "M/dd/yyyy h:mm:ss tt",

                 "longTime" : "h:mm:ss tt",

                 "days": ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],

                 "abbDays": ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],

                 "months": ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],

                 "abbMonths": ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],

                 "am": "AM",

                 "pm": "PM",

                 "dateSepa": "/",

                 "timeSepa": ":",


                 // Numeric

                 "decSymb": ".",

                 "groupNumb": 3,

                 "groupCurr": 3,

                 "groupSymb": ",",

                 "currSymb": "\u00B0C",

                 "currPos": 3,

                 "currNeg": 3,

                 "percSymb": "%",

                 "percPos": 1,

                 "percNeg": 1


CurrPos (positives) and CurrNeg (for negatives) can be one of the following

0 -> Prefix without space

1 -> Suffix without space

2 -> Prefix with extra space

3 -> Suffix with extra space 

In future builds (any build marked 5051 or later) you will be able to replace only the desired attributes, which will allow us to add new culture attributes if needed without breaking your code, so you will be able to write something like this instead

        chart1.setCulture({ "replace": true,

                 "currSymb": "\u00B0C",

                 "currPos": 3,

                 "currNeg": 3,


Hope this helps.


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.

Answer this question...

×   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...