AmCharts:将图表中的所有气球显示为x轴

时间:2017-02-15 14:02:58

标签: javascript charts amcharts

我创建了一个包含多个轴的图表。 x轴是最小周期“秒”的日期。 问题是,它只能同时显示一个气球。它应该显示所有气球。 (在这种情况下 - >两次)

dataProvider中的Date属性:d.date(新日期(年,mm,dd,hh,mm,ss,0);

...
valueAxes.push({
                        "id": "v" + i,
                        "axisColor": '#' + farbcode[i],
                        "axisThickness": 2,
                        "offset": offset,
                        "gridAlpha": 0,
                        "axisAlpha": 1,
                        "position": pos
                    });
...
graphs.push({
                        "valueAxis": "v" + i,
                        "lineColor": valueAxes[i].axisColor,
                        "bullet": "round",
                        "balloonText": "<span style='font-size:13px;'><b>[[value]]</b><br>[[dateformated]]</span>",
                        "bulletBorderThickness": 1,
                        "hideBulletsCount": 30,
                        "title": window.bezei[i],
                        "valueField": window.bezei[i],
                        "fillAlphas": 0
                    });
...


window.chart = AmCharts.makeChart(chartid[0].id, {
                    "type": "serial",
                    "theme": "light",
                    "legend": {
                        "useGraphSettings": true
                    },
                    "dataProvider": chartData,
                    "valueAxes": valueAxes,
                    "graphs": graphs,
                    "synchronizeGrid": true,
                    "chartScrollbar": {},
                    "chartCursor": {
                        "cursorPosition": "mouse"
                    },
                    "categoryField": "date",
                    "categoryAxis": {
                        "minPeriod": "ss",
                        "parseDates": true,
                        "axisColor": "#DADADA",
                        "minorGridEnabled": true
                    },
                    "export": {
                        "enabled": true,
                        "dateFormat": "YYYY-MM-DD HH:NN:SS",
                        "position": "bottom-right"
                    }
                });

enter image description here enter image description here

1 个答案:

答案 0 :(得分:0)

我发现了我的问题。

我在chartData []中为每个变量添加了一个元素。

我必须将这两个元素结合起来。

enter image description here