Annapoorni D
Annapoorni D

Reputation: 849

Highcharts : Single point in x-axis of datetime type shows 00:00:00:0000

I render a chart using highcharts the x-axis is of 'datetime' type . When I have single point in the chart the x-axis label is shown as 00:00:00:0000 instead of ('18 Nov') the given date value.

This seems to happen in highcharts version 3.0.1 where as not in 3.0.7 I did found an issue here https://github.com/highslide-software/highcharts.com/issues/1572

But in case of datetime type for x-axis how can I fix this? Is there any workaround without upgrading to latest version because that would involve verifying all other charts, which is not possible for now in my case.

Code:

 var data1 = Date.UTC(2013, 10, 18);
 var a = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            animation: false,

            width: 600,
            height: 400
        },

        plotOptions: {
            series: {
                marker: {
                    symbol: 'circle'
                }
            }
        },
        series: [{
            name: 'Total Points Estimated',
            data: [[data1,0]]
        }],
        title: {
            text: 'Release Burn-Up report'
        },

        xAxis: {
            type: 'datetime',
            gridLineWidth: 1,
            gridLineDashStyle: 'shortdot',

            title: {
                text: 'Date'
            },

        },
        yAxis: {
            gridLineDashStyle: 'shortdot',
            min: 0,
            title: {
                text: 'Backlog Effort'
            }
        }
    });

Fiddle link : http://jsfiddle.net/WdDqc/1/

enter image description here

Upvotes: 0

Views: 1520

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

Try to set minRange, for example to one day, otherwise Highcharts won't know what kind of label should be displayed. See docs.

Upvotes: 3

Related Questions