From 55f9c3be721a8e9a7626ddb302f4172effc2b216 Mon Sep 17 00:00:00 2001 From: nmykhailova Date: Mon, 21 Nov 2016 00:03:46 +0100 Subject: [PATCH] Added LegendObject and legend property to ChartObject --- highcharts/highcharts-tests.ts | 6 ++++++ highcharts/index.d.ts | 12 ++++++++++++ 2 files changed, 18 insertions(+) diff --git a/highcharts/highcharts-tests.ts b/highcharts/highcharts-tests.ts index 459d812bcc..316e2f42a6 100644 --- a/highcharts/highcharts-tests.ts +++ b/highcharts/highcharts-tests.ts @@ -2212,6 +2212,7 @@ function test_ChartObject() { chart.showLoading("Loading label"); var firstXAxis = chart.xAxis[0]; var firstYAxis = chart.yAxis[0]; + var legend = chart.legend; } function test_ElementObject() { @@ -2338,3 +2339,8 @@ function test_SeriesObject() { var xAxis = series.xAxis; var yAxis = series.yAxis; } +function test_LegendObject() { + var legend = $('#container').highcharts().legend; + legend.update({}); + legend.update({}, false); +} diff --git a/highcharts/index.d.ts b/highcharts/index.d.ts index 626ff59482..e425c0458b 100644 --- a/highcharts/index.d.ts +++ b/highcharts/index.d.ts @@ -5977,6 +5977,8 @@ declare namespace Highcharts { yAxis: AxisObject[]; renderer: RendererObject; + + legend: LegendObject; } interface Chart { @@ -6456,6 +6458,16 @@ declare namespace Highcharts { */ yAxis: AxisObject; } + + interface LegendObject { + /** + * Update the legend with new options. + * @param {LegendOptions} options New options that will be merged into the legend's existing options. + * @param [boolean] redraw - Whether to redraw the chart. Defaults to true. + * @since 5.0.0 + */ + update(options: LegendOptions, redraw?: boolean): void; + } } declare global {