Use jvcf:chartSelectInteractor to select all points of a dataset in a JSF application

Article ID: 2365
Last updated: 29 May, 2018
Article ID: 2365
Last updated: 29 May, 2018
Revision: 3
Views: 618
Posted: 13 May, 2013
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How can I select all points of my dataset in a JSF application ?

Answer

The series selection is usually made by setting the chart select interactor picking mode to "NEAREST_ITEM" (as described in the tag).

Sample code :

<jvcf:chartSelectInteractor
         id="select"
         invocationContext="IMAGE_SERVLET_CONTEXT"
         pickingMode="NEAREST_ITEM"
         valueChangeListener="#{chartBean.pointSelected}" />

The way to render the selection depends whether you use CSS or not.

1) If you use CSS, you need to :

* define a rendering rule for the selected series, for instance :

series:selected {
   marker : "DIAMOND" ;
}

* modify the pointSelected(ValueChangeEvent evt) so that it adds or removes the "selected" pseudo class on the selected dataset.

2) If you do not use CSS, you need to add a marker annotation to the chart renderer for each point of the dataset.

You can download the attached sample, based on codefragment15 of JViews Chart, that illustrates both approaches. In particular, look at the following methods ChartBean.setUseCSS(...), ChartBean.isDatasetAlreadySelected(...), ChartBean.makeDatasetSelectedWithCSS(...), and ChartBean.makeDatasetSelectedWithoutCSS(...) for details.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2365
Last updated: 29 May, 2018
Revision: 3
Views: 618
Posted: 13 May, 2013 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Attached files

Also listed in


Others in this category