문제

I am trying to create a chart using jqPlot where it shows the data for each hour. This is working fine, but as you can see in the jsfiddle, it doesn't show the first and last data point correctly. It cuts some of the circle off.

I am using this code:

$(document).ready(function () {
    var line1 = [
        ['08:00', 4],
        ['09:00', 10],
        ['10:00', 2],
        ['11:00', 12],
        ['12:00', 5],
        ['13:00', 3],
        ['14:00', 40],
        ['15:00', 2],
        ['16:00', 20],
        ['17:00', 7]
    ];
    var plot1 = $.jqplot('chart1', [line1], {
        axes: {
            xaxis: {
                renderer: $.jqplot.DateAxisRenderer,
                tickOptions: {
                    formatString: '%H:%M'
                },
                tickInterval: '1 hour',
                min: '08:00',
                max: '17:00'
            },
            yaxis: {
                min: 0
            }
        },
        seriesColors: ["#996325"],
        seriesDefaults: {
            markerOptions: {
                show: true,
                style: 'circle', // circle, diamond, square, filledCircle. filledDiamond or filledSquare.
                color: 'white',
                lineWidth: 4,
                size: 12,
                shadow: true
            }
        },
        grid: {
            background: '#365463',
            gridLineColor: 'grey'
        }
    });

});

jsFiddle

What am I doing wrong ? :(

도움이 되었습니까?

해결책

You can modify your min and max values of your xaxis in order to see the full circle of your first and last points.

xaxis:{
 min: '07:45',
 max: '17:15'
}

See example here

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top