【问题标题】:Displaying multiple series in the navigator of an HighStock chart在 HighStock 图表的导航器中显示多个系列
【发布时间】:2013-01-30 13:05:42
【问题描述】:

我想创建一个 HighStock 图表,其中包含一个显示多个系列的导航器组件,这些系列与主图中显示的系列相同。 HighStock 似乎不支持此功能,因为只允许一个系列。有没有人遇到过这个问题并设法找到可行的解决方案/替代方案?

【问题讨论】:

  • 而且,如果我没记错的话,通常会显示第一个数据系列。即使您从图例块禁用所有系列。

标签: javascript highcharts highstock


【解决方案1】:

官方不支持导航器中的多个系列,因此只有您使用的这个“hack”才能在导航器中显示多个系列。示例:http://jsfiddle.net/6fFwM/ 我们的系统在此处(http://highcharts.uservoice.com/forums/55896-general/suggestions/2361925-allow-navigator-to-have-multiple-data-series)请求此功能,因此您可以为它投票。

window.chart.addSeries({
        name : "",
        xAxis: 0,
        yAxis: 1,
        type: "line",
        enableMouseTracking: false,
        data : new_data,
        showInLegend:false
});

【讨论】:

【解决方案2】:

从 Highstock 5 开始,现在正式支持此功能。您可以全局或专门为每个系列指定showInNavigator: true (API)。一个相关的选项是navigatorOptions (API),它将影响将showInNavigator 设置为true 的系列。

例如:(JSFiddle):

plotOptions: {
    series: {
        showInNavigator: true // Global value
    }
},

series: [{ // This series has no value set and will use global
    name: 'MSFT',
    data: MSFT
},
{
    name: 'GOOGL',
    showInNavigator: false, // Individual series value
    data: GOOGL
},
{
    name: 'ADBE',
    showInNavigator: true, // Individual series value
    navigatorOptions: { // Specific values that affect the series in the navigator only
        type: 'line',
        color: 'red'
    },
    data: ADBE
}]

【讨论】:

    猜你喜欢
    • 2016-01-04
    • 1970-01-01
    • 2014-12-04
    • 1970-01-01
    • 2022-12-25
    • 2015-09-03
    • 1970-01-01
    • 1970-01-01
    • 2013-03-22
    相关资源
    最近更新 更多