简体   繁体   中英

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):

{
  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:

 {
   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.

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 ).

Please let me know if this is helpful for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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