简体   繁体   English

Highcharts-在传奇中将系列展示为一组

[英]Highcharts - show group of series as one in legend

I have array of series, where i have multiple series as one point and average line: 我有一系列的阵列,其中我有多个系列作为一个点和平均线: 在此处输入图片说明

Each point has format(eg selected GI00021): 每个点都有格式(例如,选择的GI00021):

{
  name: "GI00021",
  url: "/generalInspection/21",
  data: [null, null, null, null, null, 50]
}

I need to group this points in one title on legend, so legend will says: "General Inspections" and all points will have same marker and color. 我需要将这些点归类到图例的一个标题中,因此图例会说:“常规检查”,所有点将具有相同的标记和颜色。 Also if i will click this label - all that poins will be hide. 另外,如果我将单击此标签-所有的缺点将被隐藏。

I tried to done this by write: 我试图通过写来做到这一点:

series: [{
  name: 'General Inspections',
  data: gi_points,
    marker : {
      enabled : true
    }
  },
  ..

where gi_points array of objects: gi_points对象数组:

 {
   name: "GI00021",
   url: "/generalInspection/21",
   x: 5,
   y: 50
 }

but i have problems with lines bettween points - they should not be exist: 但是我在点之间的线有问题-它们不应该存在: 在此处输入图片说明

I think 1 desicion to show data is more correct, but i don't undestand, how to group this points into one group. 我认为1种显示数据的方法更正确,但我并不理解如何将这些点归为一组。

Rather than bringing all these inspection points in as different series, have you considered aggregating (pushing) them into one single series? 您不是考虑将所有这些检查点归为不同的系列,而是考虑将它们汇总(推入)为单个系列? That way, the chart will automatically color and label them as one entity, which will also make it far easier to turn the points on and off as needed. 这样,图表将自动为它们着色并标记为一个实体,这也将使根据需要打开和关闭这些点变得容易得多。

Now, if you wanted to show only the inspection points and not the lines between them (as I assume you want your average line to show the overall trend vs. the noise between each point), you could set the line color of your inspection point series to "transparent" and give the series markers their own color (see my answer here, with the original poster's suggestion for transparent lines: Highcharts box plot chart customization ). 现在,如果您只想显示检查点而不显示它们之间的线(我假设您希望平均线显示总体趋势与每个点之间的噪声),则可以设置检查点的线颜色系列改为“透明”,并为系列标记赋予自己的颜色(请在此处查看我的答案,以及原始海报对透明线的建议: Highcharts箱形图定制 )。

Please let me know if this is helpful for you. 如果这对您有帮助,请告诉我。

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

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