Hello,
I will combine a "SelectManyCheckbox" with a LineCharModel.
If a checkbox is activated, a line will be shown in the chart. Thats no problem!
But the linecolor depends on the order of my series.
question/example: is it possible, so set seriesX in the bean always to blue and seriesY always to red?
Primefaces 6.0
JayJay
Primefaces (Line)ChartModel define Linecolor
ChartModel provides method: public void setSeriesColors(String seriesColors),
You can set the seriesColors dynamically base on the checked items.
just like:
You can set the seriesColors dynamically base on the checked items.
just like:
Code: Select all
Map<String,String> colors = new HashMap<String,String>();
colors.put("seriesX", "00008B");
colors.put("seriesY", "8A2BE2");
colors.put(....
String seriesColors = "";
for(String item : checkedItems){
seriesColors+=colors.get(item)+",";
}
...
chartDataModel.setSeriesColors(seriesColors)
-
- Information
-
Who is online
Users browsing this forum: Google [Bot] and 65 guests