1

我用图形库创建了一个折线图。但它不能正常工作: - x 轴步骤不显示文本。- y 轴步长显示不正确的mersuare。这是代码:

var paper = Raphael("chartNode","100%","100%");
        xAxis = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
        yData = [1,2,3,4,5,6,7,8,9,10,11,12];
        options = {
            symbol: "circle",
            nostroke: false,
            smooth: false,
            shade: true,
            colors: ["#ffcc00","#ff0000"],
            axis: "0 0 1 1",
            axisxstep: xAxis.length - 1,
            axisystep: 10
        };


        var lines = paper.linechart(70,60,850,350,[0,1,2,3,4,5,6,7,8,9,10,11],yData,options);

        lines.hoverColumn(function() {
            this.tags = paper.set();
            for ( var i = 0, ii = this.y.length; i < ii; i++) {
                tagDegree = i * 90 + 45;
                var nTag = paper.popup(this.x, this.y[i], ": "
                        + this.values[i], 'right', 5);
                this.tags.push(nTag.insertBefore(this).attr([ {
                    fill : "#8F6F4F"
                }, {
                    fill : "#ffffff"
                } ]));

            }
        }, function() {
            this.tags && this.tags.remove();
        });

        //set text for x axis
        $.each(lines.axis[0].text.items, function(index, label) {
            this.attr("text", xAxis[index]);
        });

        lines.symbols.attr({
            r:5
        });

结果:结果

请!帮我。

4

1 回答 1

1

工作正常。我认为您的 jquery ui lib 存在错误。尝试在这里重新下载最新的:http: //jqueryui.com/download/

于 2013-06-11T05:02:43.367 回答