0

以下数组表示我的 Fusion Chart(条形图)的 X 轴元数据。如果日期是今天,即当前日期,我的要求是呈现一条垂直线。

例如:如果今天Wed 30-Aug-2011,我在数组中插入一个垂直线对象。这工作正常,一条线被适当地渲染。

但是,如果今天Wed 31-Aug-2011,我将vline对象插入到数组的末尾。这一次,融合图表不呈现垂直线。

该页面指出,可以在任意两个数据点之间放置垂直线。

我知道在这种情况下没有两个数据点(即vline对象不在两个数据点之间)但是有没有办法仍然渲染线?我发现了一个 hack,它是在对象之后插入一个空白标签,vline但同样,它是一个 hack,它在右端创建了一个明显的空白区域。我们有合适的解决方案吗?或者这是我必须处理的限制?

[
    {
        "label": "Mon 01-Aug-2011"
    },
    {
        "label": "Tue 02-Aug-2011"
    },
    {
        "label": "Wed 03-Aug-2011"
    },
    {
        "label": "Thu 04-Aug-2011"
    },
    {
        "label": "Fri 05-Aug-2011"
    },
    {
        "label": "Sat 06-Aug-2011"
    },
    {
        "label": "Sun 07-Aug-2011"
    },
    {
        "label": "Mon 08-Aug-2011"
    },
    {
        "label": "Tue 09-Aug-2011"
    },
    {
        "label": "Wed 10-Aug-2011"
    },
    {
        "label": "Thu 11-Aug-2011"
    },
    {
        "label": "Fri 12-Aug-2011"
    },
    {
        "label": "Sat 13-Aug-2011"
    },
    {
        "label": "Sun 14-Aug-2011"
    },
    {
        "label": "Mon 15-Aug-2011"
    },
    {
        "label": "Tue 16-Aug-2011"
    },
    {
        "label": "Wed 17-Aug-2011"
    },
    {
        "label": "Thu 18-Aug-2011"
    },
    {
        "label": "Fri 19-Aug-2011"
    },
    {
        "label": "Sat 20-Aug-2011"
    },
    {
        "label": "Sun 21-Aug-2011"
    },
    {
        "label": "Mon 22-Aug-2011"
    },
    {
        "label": "Tue 23-Aug-2011"
    },
    {
        "label": "Wed 24-Aug-2011"
    },
    {
        "label": "Thu 25-Aug-2011"
    },
    {
        "label": "Fri 26-Aug-2011"
    },
    {
        "label": "Sat 27-Aug-2011"
    },
    {
        "label": "Sun 28-Aug-2011"
    },
    {
        "label": "Mon 29-Aug-2011"
    },
    {
        "label": "Tue 30-Aug-2011"
    },       
    {
        "label": "Wed 31-Aug-2011"
    },
    {
        "vline": "true",
        "thickness": "2",
        "dashed": "1",
        "linePosition ": "0",
        "dashGap": "2"
    }
]
4

1 回答 1

1

一个黑客将是:

将 vline 定义放在最后一个类别之前,并设置linePosition: 1如下:

[
    {
        "label": "Mon 01-Aug-2011"
    },
    {
        "label": "Tue 02-Aug-2011"
    },
    {
        "label": "Wed 03-Aug-2011"
    },
    {
        "label": "Thu 04-Aug-2011"
    },
    {
        "label": "Fri 05-Aug-2011"
    },
    {
        "label": "Sat 06-Aug-2011"
    },
    {
        "label": "Sun 07-Aug-2011"
    },
    {
        "label": "Mon 08-Aug-2011"
    },
    {
        "label": "Tue 09-Aug-2011"
    },
    {
        "label": "Wed 10-Aug-2011"
    },
    {
        "label": "Thu 11-Aug-2011"
    },
    {
        "label": "Fri 12-Aug-2011"
    },
    {
        "label": "Sat 13-Aug-2011"
    },
    {
        "label": "Sun 14-Aug-2011"
    },
    {
        "label": "Mon 15-Aug-2011"
    },
    {
        "label": "Tue 16-Aug-2011"
    },
    {
        "label": "Wed 17-Aug-2011"
    },
    {
        "label": "Thu 18-Aug-2011"
    },
    {
        "label": "Fri 19-Aug-2011"
    },
    {
        "label": "Sat 20-Aug-2011"
    },
    {
        "label": "Sun 21-Aug-2011"
    },
    {
        "label": "Mon 22-Aug-2011"
    },
    {
        "label": "Tue 23-Aug-2011"
    },
    {
        "label": "Wed 24-Aug-2011"
    },
    {
        "label": "Thu 25-Aug-2011"
    },
    {
        "label": "Fri 26-Aug-2011"
    },
    {
        "label": "Sat 27-Aug-2011"
    },
    {
        "label": "Sun 28-Aug-2011"
    },
    {
        "label": "Mon 29-Aug-2011"
    },
    {
        "label": "Tue 30-Aug-2011"
    },
    {
        "vline": "true",
        "thickness": "2",
        "dashed": "1",
        "linePosition ": "1",
        "dashGap": "2"
    },       
    {
        "label": "Wed 31-Aug-2011"
    }
]

确保您已设置canvasPadding或隐藏画布边框以确保 vline 不与画布边框重叠。

于 2013-06-03T16:20:52.007 回答