Recommended Posts


When a  scrollline2d, there is a case where _allTicks is undefined

        ticks = axisConfig._allTicks,
        len = ticks.length;

And crash totally FusionCharts :

zone.js:199 Uncaught TypeError: Cannot read property 'length' of undefined
    at CategoryAxis._parseCategoryPlotLine (fusioncharts.js:80291)
    at CategoryAxis._parseReferenceVisuals (fusioncharts.js:81690)
    at CategoryAxis._parseReferenceVisuals (fusioncharts.js:86654)
    at CategoryAxis.setVisibleConfig (fusioncharts.js:81559)
    at ScrollLine2D._setAxisScale2 (fusioncharts.charts.js:9514)
    at ScrollLine2D._setAxisScale (fusioncharts.charts.js:9636)
    at ScrollLine2D._spaceManager (fusioncharts.js:73503)
    at ScrollLine2D._manageSpace (fusioncharts.js:75024)
    at ScrollLine2D.manageSpace (fusioncharts.js:75402)
    at ScrollLine2D.updateVisual (fusioncharts.js:15894)
    at Object.ComponentBase.component.__drawJob [as job] (fusioncharts.js:15477)
    at executeJob (fusioncharts.js:14619)
    at ZoneDelegate.ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneDelegate.invokeTask (zone.js:423)
    at Zone.ac_polyfills../node_modules/zone.js/dist/zone.js.Zone.runTask (zone.js:195)
    at ac_polyfills../node_modules/zone.js/dist/zone.js.ZoneTask.invokeTask (zone.js:498)
    at ZoneTask.invoke (zone.js:487)
    at timer (zone.js:2281)

 

Share this post


Link to post
Share on other sites

Hi,
With this structure,

In owr application fusionchart crashes, but not in a test case :
 

{
  "chart": {
    "baseFont": "\"Source Sans Pro\", sans-serif",
    "decimalSeparator": ",",
    "thousandSeparator": " ",
    "decimals": 2,
    "baseFontSize": 14,
    "borderThickness": 0,
    "plotBorderThickness": 0,
    "canvasBorderThickness": 0,
    "caption": "",
    "showAlternateHGridColor": 0,
    "zeroPlaneThickness": 1,
    "labelDisplay": "none",
    "labelStep": 1,
    "labelBinSize": 0,
    "flatScrollBars": 1,
    "scrollheight": 15,
    "bgColor": "#FFFFFF",
    "canvasBgColor": "#FFFFFF",
    "bgAlpha": 0,
    "canvasBgAlpha": 0,
    "numberScaleValue": "1000,1000,1000",
    "numberScaleUnit": "k,M,G",
    "use3DLighting": false,
    "legendPosition": "bottom",
    "legendItemFontSize": 12,
    "legendBorderAlpha": 0,
    "legendShadow": 0,
    "showShadow": false,
    "enableSlicing": false,
    "slicingDistance": 0,
    "enableMultiSlicing": false,
    "numbersuffix": "€",
    "showLegend": false,
    "showValues": false,
    "scrollPadding": 10,
    "usePlotGradientColor": false,
    "setAdaptiveYMin": true,
    "yAxisValuesPadding": 10,
    "labelPadding": 10,
    "canvasPadding": 25,
    "paletteColors": "#7B68EE"
  },
  "categories": [
    {
      "category": {
        "label": "JUIN"
      }
    },
    {
      "category": {
        "label": "JUIL"
      }
    },
    {
      "category": {
        "label": "AOÛT"
      }
    },
    {
      "category": {
        "label": "SEPT"
      }
    },
    {
      "category": {
        "label": "OCT"
      }
    },
    {
      "category": {
        "label": "NOV"
      }
    },
    {
      "category": {
        "label": "DÉC"
      }
    },
    {
      "category": {
        "label": "JANV"
      }
    },
    {
      "category": {
        "label": "FÉVR"
      }
    },
    {
      "category": {
        "label": "MARS"
      }
    },
    {
      "category": {
        "label": "AVRIL"
      }
    },
    {
      "category": {
        "label": "MAI"
      }
    },
    {
      "category": {
        "label": "JUIN"
      }
    }
  ],
  "dataset": [
    {
      "value": 210.65
    },
    {
      "value": 564.65
    },
    {
      "value": 261.45
    },
    {
      "value": 166.99
    },
    {
      "value": 356.62
    },
    {
      "value": 405.76
    },
    {
      "value": 715.48
    },
    {
      "value": 562.69
    },
    {
      "value": 629.62
    },
    {
      "value": 310.29
    },
    {
      "value": 151.82
    },
    {
      "value": 83.73
    },
    {
      "value": 212.68
    }
  ]
}

It's strange...
 

Share this post


Link to post
Share on other sites

Hi,

 

The categories object that you have defined is not complying to the prescribed format of FusionCharts scroll chart. Please check the below structure of "categories" object array :

"categories": [
        {
            "category": [
                {
                    "label": "Jan 2016"
                },
                {
                    "label": "Feb 2016"
                },
                {
                    "label": "Mar 2016"
                },
                {
                    "label": "Apr 2016"
                },
                {
                    "label": "May 2016"
                },
                {
                    "label": "Jun 2016"
                },
                {
                    "label": "Jul 2016"
                },
                {
                    "label": "Aug 2016"
                },
                {
                    "label": "Sep 2016"
                },
                {
                    "label": "Oct 2016"
                },
                {
                    "label": "Nov 2016"
                },
                {
                    "label": "Dec 2016"
                }
            ]
        }
    ]

 

Also the "dataset" object array is not as per the prescribed format. It should have "data" object array within the "dataset" objects. Refer to the below snippet :

"dataset": [{
        "data": [{
            "value": 210.65
          },
          {
            "value": 564.65
          },
          {
            "value": 261.45
          }]
      }]

 

Find a sample fiddle modifying the structure of your JSON dataSource : http://jsfiddle.net/czhu8bvt/3/

 

Thanks,

Akash.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now