Shyam Kumar Sundarakumar
Shyam Kumar Sundarakumar

Reputation: 5787

Primefaces Charts without shadow

I am using Primefaces barChart in one of my projects where in a small area I need to display a chart that contains multiple data points. When the chart is rendered, the bars become very thin, which is ok for me. However, there are shadows of each of the bars that look confusing on the chart.

Is it possible to disable shadows in Primefaces charts?

Upvotes: 0

Views: 1587

Answers (2)

Duloren
Duloren

Reputation: 2711

I know that it is an old question but for anyone else looking for help here you can do:

BarChartModel barChartModel = new BarChartModel();
barChartModel.setShadow(false);

It work also with linecharts:

LineChartModel result = new LineChartModel();
result.setShadow(false);

and should work with other kinds of charts as well.

Upvotes: 0

damian
damian

Reputation: 4044

The bar chart has a 'shadow' attribute. Setting it to false should make the shadow dissapear. However, at least in version 3.1.1 I was not able to make the shadow dissapear using this attribute, it seems that it doesn't work. If you have the same issue, add the following style to your css file:

.jqplot-series-shadowCanvas {
    display: none;
}

It hides the shadows of bar chart (and probably the shadow of other charts too, I haven't tested it).

Upvotes: 1

Related Questions