ฉันมีความต้องการที่จะพล็อตประวัติการรันของงานใน Highcharts ต้องแสดงประวัติการเรียกใช้งานเป็นแถบแนวนอน มีข้อกำหนดเพิ่มเติมที่ฉันได้เพิ่มเป็นอัปเดตด้านล่างนี้ เมื่อเร็ว ๆ นี้ฉันพบว่าinvertedตัวเลือกนั้นไม่รองรับในStockChartและมีเพียงnavigator & rangeSelector เท่านั้นที่มีอยู่ใน StockChart ดังนั้นฉันจึงใช้ฟังก์ชันเหล่านั้น
ดังนั้นเพื่อให้บรรลุความต้องการฉันได้สร้างสิ่งที่คล้ายกับตัวอย่าง jsfiddle นี้ (พบที่ไหนสักแห่งในขณะที่ท่องเว็บจำแหล่งที่มาไม่ได้) และลงเอยด้วยลิงก์ plunker นี้ด้วยความช่วยเหลือจากคำถามก่อนหน้าของฉันขอบคุณPawel Fus
กำลังอัปเดตคำถามเพื่อหลีกเลี่ยงความสับสน
ข้อกำหนดเพิ่มเติม:
แสดงเฉพาะงานที่ทำงานในช่วงวันที่และเวลาที่กำหนด ในกรณีที่มีการรันมากเกินไปเช่นมากกว่า 10 รันจำเป็นต้องมีวิธีแสดงเพียง 10 งานที่มองเห็นได้ด้วยแกน y ที่เลื่อนได้เพื่อแสดงงานอื่น ๆ plunker เชื่อมโยงไปยังปัญหา
คำอธิบายปัญหาของคนดังกล่าวข้างต้น
หากคุณตรวจสอบภาพด้านล่างจาก plunker ข้างต้นช่วงเวลาที่จาก12/12/2014 09:32:26ไป12/12/2014 10:32:26และมีเพียง 2 งานที่มีการเรียกใช้งานm_ARRAYV_SALES_ZIG1_CALL2_VOD__C_OB m_ZIG2_HCP_MERGE_IB_CNอย่างไรก็ตามฉันเห็นงานอื่นระหว่างLILLY_Cที่ไม่ได้ทำงานในช่วงวันที่นี้ด้วยซ้ำ (ในข้อมูลจริงมีงานมากกว่า 10 งานที่รวมแผนภูมินี้ซึ่งไม่ได้อยู่ภายใต้ช่วงเวลาวันที่นี้ด้วยซ้ำ)
นอกจากนี้ถ้าคุณสังเกตเห็นที่ด้านล่างส่วนใหญ่เวลาที่มุมขวาเปลี่ยนจากการ09:38 เป็นเวลาสิ้นสุดของงาน
ด้านล่างนี้คือตัวเลือกแผนภูมิของฉัน19:2019:20m_ZIG2_HCP_MERGE_IB_CN
    var chart_options = {
            chart: {
                renderTo: 'container',
                height: 600
            },
            title: {
            },
            credits: {
                enabled: false
            },
            xAxis: {
                type: 'datetime',
                gridLineWidth: 1,
                tickInterval: 1 * 3600 * 1000,
                dateTimeLabelFormats: {
                    month: '%b %e, %Y'
                }
            },
            yAxis: {                    
                tickInterval: 1,
                gridLineWidth: 1,
                labels: {
                    formatter: function() {
                        if (tasks[this.value]) {
                            return tasks[this.value].name;
                        }
                    }
                },
                startOnTick: false,
                endOnTick: false,
                title: {
                    text: 'Task'
                }
            },
            rangeSelector: {
                selected: 0,
                buttons: [ {
                    type: "minute",
                    count: 60,
                    text: "1h"
                }, {
                    type: "minute",
                    count: 180,
                    text: "3h"
                }, {
                    type: "minute",
                    count: 300,
                    text: "5h"
                }],
                inputDateFormat: '%m/%d/%Y %H:%M:%S',
                inputEditDateFormat: '%m/%d/%Y %H:%M:%S',
                inputBoxWidth: 120
            },
            navigator: {
                enabled: false
            },
            legend: {
                enabled: false
            },
            tooltip: {
                shared: false,
                formatter: function() {
                    var str = '';
                    str += 'Task: ' + this.series.name + '<br>';
                    str += 'From: ' + Highcharts.dateFormat('%m/%d/%y %H:%M', this.point.from) + '<br>';
                    str += 'To: ' + Highcharts.dateFormat('%m/%d/%y %H:%M', this.point.to) + '<br>';
                    return str;
                }
            },
            plotOptions: {
                line: {
                    lineWidth: 10,
                    marker: {
                        enabled: true
                    },
                    dataLabels: {
                        enabled: true,
                        align: 'left',
                        formatter: function() {
                            return this.point.options && this.point.options.label;
                        }
                    },
                    states:{
                        hover:{
                            lineWidth:10
                        }
                    }
                },
                series: {
                    cursor: 'pointer',
                    point: {
                        events: {
                            click: function () {
                                var query = '{ "task_id": "'+this.task_id+'","start_time": '+this.from+',"exclude_interval": '+opExcludeMinutes+',"size": 10 }';
                                $scope.taskName = this.series.name;
                                $scope.isTaskSelected = false;
                                $scope.operationalReportAgentTaskHistoryServiceRequest(query);
                            }
                        }
                    }
                }
            },
            series: seriesData
        };