Skip to content

Added legendItemClick to WHighChartChartEventsOptions #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public class WHighChartChartEventsOptions implements Serializable
* which are arrays containing the axes of each dimension and each axis' value at the
* clicked spot. The primary axes are event.xAxis[0] and event.yAxis[0]. Remember the
* unit of a datetime axis is milliseconds since 1970-01-01 00:00:00.
*
*
* <pre>
* click: function(e) {
* console.log(
* Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', e.xAxis[0].value),
* Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', e.xAxis[0].value),
* e.yAxis[0].value
* )
* }
Expand Down Expand Up @@ -80,7 +80,7 @@ public class WHighChartChartEventsOptions implements Serializable
* which are arrays containing the axes of each dimension and each axis' min and max
* values. The primary axes are event.xAxis[0] and event.yAxis[0]. Remember the unit
* of a datetime axis is milliseconds since 1970-01-01 00:00:00.
*
*
* <pre>
* selection: function(event) {
* // log the min and max of the primary, datetime x-axis
Expand All @@ -95,6 +95,16 @@ public class WHighChartChartEventsOptions implements Serializable
*/
private WHighChartFunction selection;

/**
* Fires when the legend item belonging to the series is clicked. The this keyword
* refers to the series object itself. One parameter, event, is passed to the
* function. This contains common event information based on jQuery or MooTools
* depending on which library is used as the base for Highcharts. The default action
* is to toggle the visibility of the series. This can be prevented by returning false
* or calling event.preventDefault().
*/
private WHighChartFunction legendItemClick;

public WHighChartFunction getAddSeries()
{
return addSeries;
Expand Down Expand Up @@ -174,4 +184,15 @@ public WHighChartChartEventsOptions setSelection(String formatter)
{
return setSelection(new WHighChartFunctionString(formatter));
}

public WHighChartFunction getLegendItemClick()
{
return legendItemClick;
}

public WHighChartChartEventsOptions setLegendItemClick(WHighChartFunction legendItemClick)
{
this.legendItemClick = legendItemClick;
return this;
}
}