Hi,
Example code for inlined charts, hover on a point is simple when records only contain one
point, but here you will recieve a record with multiple values, how to know which to use??
CellRecord lvRec = new CellRecord();
lvRec.setAttribute("city", "Las Vegas");
lvRec.setAttribute("spring", "79");
lvRec.setAttribute("summer", "102");
lvRec.setAttribute("autumn", "81");
lvRec.setAttribute("winter", "59");
CellRecord nyRec = new CellRecord();
nyRec.setAttribute("city", "New York");
nyRec.setAttribute("spring", "60");
nyRec.setAttribute("summer", "83");
nyRec.setAttribute("autumn", "66");
nyRec.setAttribute("winter", "40");
// Creating inlined facet
Facet inlinedFacet = new Facet();
inlinedFacet.setInlinedValues(true);
inlinedFacet.setValues(
new FacetValue("spring", "Spring"),
new FacetValue("summer", "Summer"),
new FacetValue("autumn", "Autumn"),
new FacetValue("winter", "Winter"));
// Creating chart
FacetChart chart = new FacetChart();
chart.setFacets(inlinedFacet, new Facet("city", "City"));
chart.setData(new Record[]{lvRec, nyRec});
chart.setStacked(false);
chart.setTitle("Average temperatures");
Example code for inlined charts, hover on a point is simple when records only contain one
point, but here you will recieve a record with multiple values, how to know which to use??
CellRecord lvRec = new CellRecord();
lvRec.setAttribute("city", "Las Vegas");
lvRec.setAttribute("spring", "79");
lvRec.setAttribute("summer", "102");
lvRec.setAttribute("autumn", "81");
lvRec.setAttribute("winter", "59");
CellRecord nyRec = new CellRecord();
nyRec.setAttribute("city", "New York");
nyRec.setAttribute("spring", "60");
nyRec.setAttribute("summer", "83");
nyRec.setAttribute("autumn", "66");
nyRec.setAttribute("winter", "40");
// Creating inlined facet
Facet inlinedFacet = new Facet();
inlinedFacet.setInlinedValues(true);
inlinedFacet.setValues(
new FacetValue("spring", "Spring"),
new FacetValue("summer", "Summer"),
new FacetValue("autumn", "Autumn"),
new FacetValue("winter", "Winter"));
// Creating chart
FacetChart chart = new FacetChart();
chart.setFacets(inlinedFacet, new Facet("city", "City"));
chart.setData(new Record[]{lvRec, nyRec});
chart.setStacked(false);
chart.setTitle("Average temperatures");