2

I have to plot a fusion chart for 30 days data. But because of too many data points, a scroll bar is coming. So I just want to plot every nth label. Inorder to reduce my x-axis size.

The fusion chart code is here :

 var ecuChart = new FusionCharts({
                    //type: 'mscolumn3d',
                    type: 'scrollline2d',
                    //type: 'msarea',
                    renderAt: 'ecuGraphBody',
                    width: "265",
                    height: "100%",
                    dataFormat: "json", 
                    dataSource: {
                        "chart": {
                            "subcaption": "Graph",
                            "xAxisname": "day",
                            "yAxisName": " $/Hour",
                            "numvisibleplot": "24",
                            "animation":"1",                           
                            "decimals":"2",
                            "showLegend": "1",
                            "numberprefix": "$",
                            "legendPosition": "bottom",
                            "legendIconScale":"1",
                            "theme":"fint",
                            "legendshadow": "0",
                            "exportenabled": "1",
                            "legendborderalpha": "0",
                            //"palettecolors": "#f8bd19,#008ee4,#33bdda,#e44a00,#6baa01,#583e78",
                            "showborder": "0",
                            "showValues": "1",
                            "labelStep" :"4"
                        },

                        "categories": [
                                       {
                                           "category": categories
                                       }
                                    ],
                       "dataset": [
                                     {
                                           "data": graphdata
                                     }
                                  ]


                    }
                }).render();


graphdata: [
                {
                    "value": "15123"
                },
                {
                    "value": "14233"
                },
                {
                    "value": "23507"
                },
                {
                    "value": "9110"
                },
                {
                    "value": "15529"
                },
                {
                    "value": "20803"
                },
                {
                    "value": "19202"
                }
                .
                .
                .
                ]

categories : [
                {
                    "label": "1"
                },
                {
                    "label": "2"
                },
                {
                    "label": "3"
                },
                {
                    "label": "4"
                },
                {
                    "label": "5"
                },
                {
                    "label": "6"
                },
                {
                    "label": "7"
                }
                .
                .
                .
                .
                {
                   "label": "30"
                }]
monica
  • 1,454
  • 14
  • 28

1 Answers1

1

Try the attribute labelStep and define how many labels you want to skip. You will get the details from this link

pallabB
  • 189
  • 8
  • I tried using labelStep. It just reduces the number of labels shown on x-axis, but doesn't reduces the number of plotted points, because of which my x-axis size is still the same. – monica Feb 08 '16 at 08:01
  • 1
    If you do not want to show labels as well as data, you should not have it in the data itself. There is no way to determine which data point to keep and which to skip. Hope this help. If you have a separate concern, space or performance, for large data, then let me know. – pallabB Feb 09 '16 at 06:38
  • Yeah I have used that solution only. Before plotting the data, I am parsing it based on my required number of points. Thanks – monica Feb 09 '16 at 13:24