1

I want to use dates at graphael charts, as below.

var lines = r.linechart(30, 30, 600, 440, [
    [01 / 01 / 2014 12: 00: 00, 02 / 01 / 2014 12: 00: 00, 03 / 01 / 2014 12: 00: 00, 04 / 01 / 2014 12: 00: 00, 05 / 01 / 2014 12: 00: 00]
], [
    [100, 150, 130, 85, 100]
], {
    axisxstep: 20,
    nostroke: false,
    axis: "0 0 1 1",
    symbol: "circle",
    smooth: true
}).hoverColumn(function () {
    this.tags = r.set();

    for (var i = 0, ii = this.y.length; i < ii; i++) {
        this.tags.push(r.tag(this.x, this.y[i], this.values[i], 160, 10).insertBefore(this).attr([{
            fill: "#fff"
        }, {
            fill: this.symbols[i].attr("fill")
        }]));
    }
}, function () {
    this.tags && this.tags.remove();
});

However, graphael, seems that cannot recognize dates. If I set those values instead of dates to 1,2,3 ... , how I can show the dates labels at the x axis afterwards?

Thanks again

1 Answer 1

1

Try to use dates in milliseconds. To render dates at the x axis in any format you need you can do as described here: https://bocoup.com/weblog/alternate-x-axis-intervals-in-g-raphael-js-linechart

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.