Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit 36bb910

Browse files
committed
#21 added support for HiEvents
1 parent 262ddc3 commit 36bb910

File tree

5 files changed

+73
-14
lines changed

5 files changed

+73
-14
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export declare function eventsHandler(eventsOptions: any): any;
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
2+
import { optionsBuilder } from "../helpers/helpers";
3+
import { isAndroid } from "@nativescript/core";
4+
5+
export function eventsHandler(eventsOptions) {
6+
const events = isAndroid ? new com.highsoft.highcharts.common.hichartsclasses.HIEvents() : new HIEvents();
7+
8+
const eventsSchema = {
9+
add: 'HIFunction',
10+
addSeries: 'HIFunction',
11+
afterAnimate: 'HIFunction',
12+
afterBreaks: 'HIFunction',
13+
afterPrint: 'HIFunction',
14+
afterSetExtremes: 'HIFunction',
15+
afterUpdate: 'HIFunction',
16+
beforePrint: 'HIFunction',
17+
checkboxClick: 'HIFunction',
18+
click: 'HIFunction',
19+
closePopup: 'HIFunction',
20+
deselectButton: 'HIFunction',
21+
drag: 'HIFunction',
22+
dragStart: 'HIFunction',
23+
drillToCluster: 'HIFunction',
24+
drilldown: 'HIFunction',
25+
drillup: 'HIFunction',
26+
drillupall: 'HIFunction',
27+
drop: 'HIFunction',
28+
exportData: 'HIFunction',
29+
hide: 'HIFunction',
30+
legendItemClick: 'HIFunction',
31+
load: 'HIFunction',
32+
mouseOut: 'HIFunction',
33+
mouseOver: 'HIFunction',
34+
mousemove: 'HIFunction',
35+
mouseout: 'HIFunction',
36+
mouseover: 'HIFunction',
37+
pointBreak: 'HIFunction',
38+
pointInBreak: 'HIFunction',
39+
redraw: 'HIFunction',
40+
remove: 'HIFunction',
41+
render: 'HIFunction',
42+
select: 'HIFunction',
43+
selectButton: 'HIFunction',
44+
selection: 'HIFunction',
45+
setExtremes: 'HIFunction',
46+
setRootNode: 'HIFunction',
47+
show: 'HIFunction',
48+
showPopup: 'HIFunction',
49+
unselect: 'HIFunction',
50+
update: 'HIFunction'
51+
};
52+
53+
return optionsBuilder(eventsSchema, eventsOptions, events);
54+
}

src/options-handlers/helpers/_helpers.common.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ export declare const typesMap: {
6262
HIDateTimeLabelFormats: (options: any) => any;
6363
HIDataLabels: (options: any) => java.util.ArrayList<any>;
6464
HIExporting: (options: any) => any;
65+
HIEvents: (options: any) => any;
6566
HIFunction: (options: any) => com.highsoft.highcharts.core.HIFunction | HIFunction;
6667
HIHover: (options: any) => any;
6768
HILabel: (options: any) => any;

src/options-handlers/helpers/_helpers.common.ts

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,20 @@ import { frontHandler } from '../frame/front/front-handler';
3434
import { leftHandler } from '../frame/left/left-handler';
3535
import { rightHandler } from '../frame/right/right-handler';
3636
import { topHandler } from '../frame/top/top-handler';
37+
import { layoutAlgorithmHandler } from "../layoutAlgorithm/layoutAlgorithm-handler";
38+
import { linkHandler } from "../link/link-handler";
39+
import { exportingHandler } from "../exporting/exporting-handler";
40+
import { frameHandler } from "../frame/frame-handler";
41+
import { options3dHandler } from "../options3d/options3d-handler";
42+
import { navigationHandler } from "../navigation/navigation-handler";
43+
import { annotationsOptionsHandler } from "../annotationsOptions/annotationsOptions-handler";
44+
import { animationOptionsObjectHandler } from "../animationOptionsObject/animationOptionsObject-handler";
45+
import { popupHandler } from "../popup/popup-handler";
46+
import { shapesHandler } from "../shapes/shapes-handler";
47+
import { buttonOptionsHandler } from "../buttonOptions/buttonOptions-handler";
48+
import { themeHandler } from "../theme/theme-handler";
49+
import { annotationsHandler } from "../annotations/annotations-handler";
50+
import { eventsHandler } from "../events/events-handler";
3751

3852
// Series Handler imports
3953
import { areaHandler } from '../series/area/area-handler';
@@ -86,19 +100,7 @@ import { waterfallHandler } from '../series/waterfall/waterfall-handler';
86100
import { windbarbHandler } from '../series/windbarb/windbarb-handler';
87101
import { wordcloudHandler } from '../series/wordcloud/wordcloud-handler';
88102
import { xrangeHandler } from '../series/xrange/xrange-handler';
89-
import { layoutAlgorithmHandler } from "../layoutAlgorithm/layoutAlgorithm-handler";
90-
import { linkHandler } from "../link/link-handler";
91-
import { exportingHandler } from "../exporting/exporting-handler";
92-
import { frameHandler } from "../frame/frame-handler";
93-
import { options3dHandler } from "../options3d/options3d-handler";
94-
import { navigationHandler } from "../navigation/navigation-handler";
95-
import { annotationsOptionsHandler } from "../annotationsOptions/annotationsOptions-handler";
96-
import { animationOptionsObjectHandler } from "../animationOptionsObject/animationOptionsObject-handler";
97-
import { popupHandler } from "../popup/popup-handler";
98-
import { shapesHandler } from "../shapes/shapes-handler";
99-
import { buttonOptionsHandler } from "../buttonOptions/buttonOptions-handler";
100-
import { themeHandler } from "../theme/theme-handler";
101-
import { annotationsHandler } from "../annotations/annotations-handler";
103+
102104

103105
const seriesHandlers = {
104106
'HIArea': (options) => areaHandler(options),
@@ -174,6 +176,7 @@ export const typesMap = {
174176
// 'HIDefs': (options) => defsHandler(options),
175177
// 'HIDrilldown': (options) => drilldownHandler(options),
176178
'HIExporting': (options) => exportingHandler(options),
179+
'HIEvents': (options) => eventsHandler(options),
177180
'HIFunction': (options) => functionHandler(options),
178181
'HIHover': (options) => hoverHandler(options),
179182
'HILabel': (options) => labelHandler(options),

src/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nativescript/ui-charts",
3-
"version": "0.1.0",
3+
"version": "0.1.1",
44
"description": "Nativescript wrapper for Highcharts iOS and Android SDKs",
55
"main": "ui-charts",
66
"typings": "index.d.ts",

0 commit comments

Comments
 (0)