Merge pull request #29053 from richardison/fix_highstock_button_event

[@types/highcharts] Add click event type to range selector button
This commit is contained in:
Jesse Trinity
2018-09-20 15:13:29 -07:00
committed by GitHub
2 changed files with 15 additions and 1 deletions
+7 -1
View File
@@ -2,7 +2,8 @@
// Project: http://www.highcharts.com/
// Definitions by: David Deutsch <http://github.com/DavidKDeutsch>
// Definitions by: Dave Baumann <https://github.com/route2Dev>
// Dave Baumann <https://github.com/route2Dev>
// Richard Ison <https://github.com/richardison>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Highcharts from "highcharts";
@@ -31,11 +32,16 @@ declare namespace Highstock {
yAxis?: Highcharts.AxisOptions;
}
interface RangeSelectorButtonEvent {
click?(event: Event): void;
}
interface RangeSelectorButton {
type: string; // Defines the timespan, can be one of 'millisecond', 'second', 'minute', 'day', 'week', 'month', 'ytd' (year to date), 'year' and 'all'.
count?: number;
text: string;
dataGrouping?: any; // not sure how this works
events?: RangeSelectorButtonEvent;
}
interface RangeSelectorOptions {
+8
View File
@@ -25,6 +25,14 @@ $(() => {
rangeSelector: {
allButtonsEnabled: true,
selected: 1,
buttons: [{
type: 'month',
count: 1,
text: '1m',
events: {
click: () => { }
}
}],
buttonTheme: { // styles for the buttons
fill: 'none',
stroke: 'none',