I'm using Primefaces 5.1 and trying to set the model.datatipformat of a LineChartModel to display the label for each series. I can assign a string to this, but only at the model level so all of the lines will have the same string. For a chart with several series, it's difficult to determine which line corresponds to which series and being able to hover over the line to get the series name would be very useful. Wondering if there is a work-around.
public Bean() {
model = new LineChartModel();
LineChartSeries series1 = new LineChartSeries();
series1.setLabel("Series 1");
series1.set(1, 2);
series1.set(2, 1);
series1.set(3, 3);
series1.set(4, 6);
series1.set(5, 8);
LineChartSeries series2 = new LineChartSeries();
series2.setLabel("Series 2");
series2.set(1, 6);
series2.set(2, 3);
series2.set(3, 2);
series2.set(4, 7);
series2.set(5, 9);
model.addSeries(series1);
model.addSeries(series2);
model.setTitle("Linear Chart");
model.setLegendPosition("e");
model.setDataTipFormat("Want the series name here!!!");
Axis yAxis = model.getAxis(AxisType.Y);
yAxis.setMin(0);
yAxis.setMax(10);
}
Hello,
RépondreSupprimerDo you want to put the series name in dataTipFormat?
do you got
RépondreSupprimer