0
votes

I am using highCharts to plot certain data points in a column chart. My x-axis is datetimestamped and y-axis is simple numeric frequency.

Two of my datapoints are overlapping. I want them to be shown as separate columns on the chart. I also want my x-axis to show only month 'year.

My JavaScript is below:

$(function () {
    $('#container').highcharts({
        chart: {
            type: 'column'
        },
        xAxis: {
    type:'datetime',
            dateTimeLabelFormats: {
                        month: '%b \'%y'
            },          
    tickInterval: 24 * 3600 * 1000 * 30
    },
        yAxis: {
            min: 0,
            title: {
                text: 'Frequency'
            }
        },
        plotOptions: {
            column: {
            pointPadding: 0.2,
            pointWidth: 10
            }
        },
        series: [{"name":"warning","data":[{"x":1367391600000,"y":1}]},{"name":"pass","data":[{"x":1367391600000,"y":2}]},{"name":"fail","data":[{"x":1370070000000,"y":1}]}]
    });
});

ISSUE:

My first and second datapoints are overlapping columns. IF one is shown, other gets hidden. Can somebody help me with this.

http://jsfiddle.net/X4UJd/

2
Also, I want my chart to be uniformly distributed on-axis...right now it has just 2 columns on 2 extremeties of the axis.ASingh

2 Answers

0
votes

As a very quick fix, you can put what value is lower to display second so it appears in front of the other one.

series: [{"name":"pass","data":[{"x":1367391600000,"y":2}]},{"name":"warning","data":[{"x":1367391600000,"y":1}]},{"name":"fail","data":[{"x":1370070000000,"y":1}]}]

This way the height of 2 will be drawn and then the height of 1 so you can see both.