Highcharts图例如何显示多个图表数据类别?

Highcharts图例如何显示多个图表数据类别?,highcharts,legend,Highcharts,Legend,有没有办法让图例只显示类别1、类别2、类别3、类别4 期望 还是有更好的方法来树立我的榜样? 检查,我相应地更新了您的系列 series: [{ name: 'Category 1', //updated name accordingly id: 'crossSell1', data: crossSell1, dataGrouping: { units: groupingUnits }, color: '#4E79A7' }, {

有没有办法让图例只显示类别1、类别2、类别3、类别4

期望

还是有更好的方法来树立我的榜样?

检查,我相应地更新了您的系列

series: [{
    name: 'Category 1', //updated name accordingly
    id: 'crossSell1',
    data: crossSell1,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#4E79A7'
  }, {
    name: 'Category 2',
    id: 'crossSell2',
    data: crossSell2,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#F28E2B'
  }, {
    name: 'Category 3',
    id: 'crossSell3',
    data: crossSell3,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#E15759'
  }, {
    name: 'Category 4',
    id: 'crossSell4',
    data: crossSell4,

    dataGrouping: {
      units: groupingUnits
    },
    color: '#59A14F'
  }, {
    name: 'Renew',
    data: renew1,
    linkedTo: 'crossSell1',
    yAxis: 1,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#4E79A7'
  }, {
    name: 'Renew',
    data: renew2,
    linkedTo: 'crossSell2',
    yAxis: 1,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#F28E2B'
  }, {
    name: 'Renew',
    data: renew3,
    yAxis: 1,
    linkedTo: 'crossSell3',
    dataGrouping: {
      units: groupingUnits
    },
    color: '#E15759'
  }, {
    name: 'Renew',
    data: renew4,
    linkedTo: 'crossSell4',
    yAxis: 1,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#59A14F'
  }, {
    name: 'Up Sell',
    data: upSell1,
    linkedTo: 'crossSell1',
    yAxis: 2,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#4E79A7'
  }, {
    name: 'Up Sell',
    data: upSell2,
    linkedTo: 'crossSell2',
    yAxis: 2,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#F28E2B'
  }, {
    name: 'Up Sell',
    data: upSell3,
    yAxis: 2,
    linkedTo: 'crossSell3',
    dataGrouping: {
      units: groupingUnits
    },
    color: '#E15759'
  }, {
    name: 'Up Sell',
    data: upSell4,
    yAxis: 2,
    linkedTo: 'crossSell4',
    dataGrouping: {
      units: groupingUnits
    },
    color: '#59A14F'
  }]
var数据=[
[2017-01-01',252,空,77,空,空,空,77,219,空,空,空],
['2017-02-01',空,65,空,空,35,空,199,276,210,空,空,空,空],
[2017-03-01',247,244,空,50,空,66,空,空,空,空,12],
[2017-04-01',空,25,45,空,空,空,23,72,空,空,空,空],
['2017-05-01',空,空,24,85,空,65,空,空,175,空,空,0],
[2017-06-01',空,557,空,60,空,44,空,274,0,空,空,空],
[2017-07-01',空,空,50,空,35,空,199,280,空,空,空,空],
[2017-08-01',零,零,25,零,32,零,199,278,13,零,零,零,零],
['2017-09-01',空,空,空,空,150244199278,空,空,空,
[2017-10-01',空,486,35,空,空,空,空,空,空,空,空,空,空]
];
//将数据集拆分为ohlc和卷
变量crossSell1=[],
crossSell2=[],
crossSell3=[],
crossSell4=[],
更新1=[],
更新2=[],
续订3=[],
更新4=[],
upSell1=[],
upSell2=[],
upSell3=[],
upSell4=[],
dataLength=data.length,
//设置允许的数据分组单位
分组单元=[
[
“月”[2]
]
],
i=0;
对于(i;i日期:”+
date.getFullYear()+“/”+
(date.getMonth()+1)+“/”+
date.getDate()+
“
美元:$”+this.y+K”; } }, 系列:[{ 名称:“类别1”, id:'crossSell1', 数据:CrossSell 1, 数据分组:{ 单位:分组单位 }, 颜色:“#4E79A7” }, { 名称:“类别2”, id:‘crossSell2’, 数据:CrossSell 2, 数据分组:{ 单位:分组单位 }, 颜色:“#F28E2B” }, { 名称:“类别3”, id:‘crossSell3’, 数据:CrossSell 3, 数据分组:{ 单位:分组单位 }, 颜色:“#E15759” }, { 名称:“类别4”, id:‘crossSell4’, 数据:CrossSell 4, 数据分组:{ 单位:分组单位 }, 颜色:“#59A14F” }, { 姓名:'续约', 数据:1, 链接到:“crossSell1”, 亚克西斯:1,, 数据分组:{ 单位:分组单位 }, 颜色:“#4E79A7” }, { 姓名:'续约', 数据:2, 链接到:“crossSell2”, 亚克西斯:1,, 数据分组:{ 单位:分组单位 }, 颜色:“#F28E2B” }, { 姓名:'续约', 数据:3, 亚克西斯:1,, 链接到:“crossSell3”, 数据分组:{ 单位:分组单位 }, 颜色:“#E15759” }, { 姓名:'续约', 数据:4, 链接到:“crossSell4”, 亚克西斯:1,, 数据分组:{ 单位:分组单位 }, 颜色:“#59A14F” }, { 名称:“追加销售”, 数据:向上销售1, 链接到:“crossSell1”, 亚克斯:2,, 数据分组:{ 单位:分组单位 }, 颜色:“#4E79A7” }, { 名称:“追加销售”, 数据:向上销售2, 链接到:“crossSell2”, 亚克斯:2,, 数据分组:{ 单位:分组单位
series: [{
    name: 'Category 1', //updated name accordingly
    id: 'crossSell1',
    data: crossSell1,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#4E79A7'
  }, {
    name: 'Category 2',
    id: 'crossSell2',
    data: crossSell2,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#F28E2B'
  }, {
    name: 'Category 3',
    id: 'crossSell3',
    data: crossSell3,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#E15759'
  }, {
    name: 'Category 4',
    id: 'crossSell4',
    data: crossSell4,

    dataGrouping: {
      units: groupingUnits
    },
    color: '#59A14F'
  }, {
    name: 'Renew',
    data: renew1,
    linkedTo: 'crossSell1',
    yAxis: 1,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#4E79A7'
  }, {
    name: 'Renew',
    data: renew2,
    linkedTo: 'crossSell2',
    yAxis: 1,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#F28E2B'
  }, {
    name: 'Renew',
    data: renew3,
    yAxis: 1,
    linkedTo: 'crossSell3',
    dataGrouping: {
      units: groupingUnits
    },
    color: '#E15759'
  }, {
    name: 'Renew',
    data: renew4,
    linkedTo: 'crossSell4',
    yAxis: 1,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#59A14F'
  }, {
    name: 'Up Sell',
    data: upSell1,
    linkedTo: 'crossSell1',
    yAxis: 2,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#4E79A7'
  }, {
    name: 'Up Sell',
    data: upSell2,
    linkedTo: 'crossSell2',
    yAxis: 2,
    dataGrouping: {
      units: groupingUnits
    },
    color: '#F28E2B'
  }, {
    name: 'Up Sell',
    data: upSell3,
    yAxis: 2,
    linkedTo: 'crossSell3',
    dataGrouping: {
      units: groupingUnits
    },
    color: '#E15759'
  }, {
    name: 'Up Sell',
    data: upSell4,
    yAxis: 2,
    linkedTo: 'crossSell4',
    dataGrouping: {
      units: groupingUnits
    },
    color: '#59A14F'
  }]