使用指南(带文本)或打开的标注在图表上指示重要日期

Indicate an important date on a chart with either a guideline (with text) or an opened callout

我正在寻找一种在高图上用标签(例如 Public 假期)指示关键日期的方法。我找不到添加标记指南或将打开的标注添加到某个点的方法?帮助表示赞赏。

在 Highstock 中,您有一个名为 flags 的系列类型,它是一个打开的标注(类似于 Dygraphs annotation). This is probably the closest fit to the indicators you referred. See this JSFiddle example of how it looks. Note how this example uses the Highstock source file, but builds a Highcharts chart. See this documentation 的官方信息。

在 Highcharts 中,您可以通过多种方式突出显示点、标签和值。首先,您可以为您的点添加数据标签,这会在其旁边呈现文本。其次,您可以使用 plot lines to highlight certain values along an axis. See this JSFiddle example 了解如何使用这两个选项。

当然,有很多方法可以改进和构建这种开箱即用的功能,但这取决于您的具体需求和愿望。