简体   繁体   English

时间序列水平条形图,用于运行查询可视化

[英]Time series horizontal bar chart for running queries visualization

I need to build a time series horizontal bar chart that looks something like this. 我需要构建一个看起来像这样的时间序列水平条形图。 Each bar represents a query running on the cluster. 每个栏代表在集群上运行的查询。 The length of the bar represents the duration. 条形的长度代表持续时间。 Each query has start time and end time. 每个查询都有开始时间和结束时间。 Multiple queries can have either same start time or end time or both. 多个查询可以具有相同的开始时间或结束时间,或者两者都有。 Queries may be running in parallel. 查询可能正在并行运行。

在此处输入图片说明

I am using highcharts/highstocks charting library, wondering what kind of Highchart config I need to use to accomplish it. 我正在使用highcharts / highstocks图表库,想知道要使用哪种Highchart配置。 Please advise. 请指教。

I would use a columnrange series. 我会使用columnrange系列。 Here you have an example of it: https://jsfiddle.net/BlackLabel/6bu8gtaw It is hardcoded for now, you can edit it and adjust to your requirements. 在这里,您有一个示例: https ://jsfiddle.net/BlackLabel/6bu8gtaw目前,它已经进行了硬编码,您可以对其进行编辑并根据需要进行调整。

All used API properties you can find here: https://api.highcharts.com/highcharts 您可以在这里找到所有使用的API属性: https : //api.highcharts.com/highcharts

Highcharts.chart('container', {

  chart: {
    type: 'columnrange',
    inverted: true,
    height: 200,
    borderWidth: 1,
    borderColor: '#d3d3d3'
  },

  legend: {
    align: 'right',
    verticalAlign: 'middle',
    layout: 'vertical'
  },

  plotOptions: {
    series: {
      groupPadding: 0,
      pointPadding: 0.1,
      grouping: false,
      pointWidth: 6,
      borderWidth: 0
    }
  },

  title: {
    text: null
  },

  xAxis: {
    visible: false,
    reversed: false,
    min: -3,
    max: 7
  },

  yAxis: {
    opposite: true,
    min: -3,
    max: 18
  },

  series: [{
    data: [
      [0, 10, 13]
    ]
  }, {
    data: [
      [1, 2, 5]
    ]
  }, {
    data: [
      [1, 6, 9]
    ]
  }, {
    data: [
      [1, 12, 16]
    ]
  }, {
    data: [
      [2, 3, 7]
    ]
  }, {
    data: [
      [2, 7, 12]
    ]
  }, {
    data: [
      [3, 0, 4]
    ]
  }, {
    data: [
      [3, 5, 10]
    ]
  }, {
    data: [
      [3, 10, 14]
    ]
  }, {
    data: [
      [3, 16, 18]
    ]
  }, {
    data: [
      [4, 0, 5]
    ]
  }, {
    data: [
      [4, 6, 11]
    ]
  }, {
    data: [
      [4, 11, 15]
    ]
  }, {
    data: [
      [4, 16, 18]
    ]
  }]

});

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM