Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    how to use short date format for X-Axis labels in FacetChart?

    We have an Area chart that shows data for certain dates. The problem is that x-axis date/time labels take more vertical space than the chart itself because it uses the long date format. Is there a way to use the short format instead? The facet field is defined as DateTime field in the datasource. The documentation mentions that it's possible:
    The format of the Date labels is fixed by FacetChart. In particular, formatAxisValue() will not be called on values for the x-axis. However, FacetChart uses the global array of abbreviated month names for the time granularities of quarters, months, and weeks, uses the default short time format to format labels for time granularities from minutes to hours, and uses the default time format to format labels for the time granularities of 15 seconds and 30 seconds. The label format can be customized by changing these three formatters.
    but I can't find any examples. Can it be done in SmartGWT 5.1?

    #2
    The API to use is setXAxisValueFormatter. The documentation is referring to the SmartClient name for this API instead of the name used in SmartGWT - we'll fix it.

    Comment


      #3
      I added a ValueFormatter, but it wasn't called just as the documentation suggested in SmartClient Version v10.1p_2016-04-08/Enterprise Deployment. It refers to 3 formatters instead. Is there a way to influence them in SmartGWT 5.1?

      Comment


        #4
        Yes, this works in SmartGWT 5.1. You'll need to show your code, there's no way for us to tell what you've done wrong without seeing the actual code.

        Comment

        Working...
        X