如何在fusionCharts中显示每个第n个标签以处理长x轴标签?

时间:2016-02-05 11:41:07

标签: javascript fusioncharts

我必须绘制30天数据的融合图表。但由于数据点过多,滚动条即将出现。所以我只想绘制每个第n个标签。为了减少我的x轴尺寸。

融合图表代码在这里:

 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"
                }]

1 个答案:

答案 0 :(得分:1)

尝试使用属性labelStep并定义要跳过的标签数量。您将从此link

获取详细信息