changes axes in BarChartSeries

UI Components for JSF
Post Reply
giltal1
Posts: 2
Joined: 19 Aug 2018, 08:06

19 Aug 2018, 08:11

Hi,

I'm new to this community and this forum.
I am using the chart element in my website, and specifically the bar chart. unfortunately, the BarChartSeries doesn't render any changes in the default axes, meaning it only uses the x1 and y1 axes.
i read the contribution guide: https://github.com/primefaces/primeface ... IBUTING.md
It wasn't clear to me - Should i open a bug in github, or writing here is enough?
I made a local fix and it works for me, I would like to contribute this fix to the community.

Thanks

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

20 Aug 2018, 13:42

Please post your exact issue and fix in detail here and we can determine whether it needs to be added to the source!
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

giltal1
Posts: 2
Joined: 19 Aug 2018, 08:06

20 Aug 2018, 16:02

to sum it shortly:

bug: BarChartSeries does not take into count x-axis or y-axis which were set using setters during rendering.
suggested solution: add to "encode" function on BarChartSeries (which renders the element) a check for x and y axes.
added code is highlighted.

public void encode(Writer writer) throws IOException {
AxisType xaxis = this.getXaxis();
AxisType yaxis = this.getYaxis();

writer.write("{");
writer.write("label:\"" + ComponentUtils.escapeText(this.getLabel()) + "\"");
writer.write(",renderer: $.jqplot." + this.getRenderer());
if (xaxis != null) {
writer.write(",xaxis:\"" + xaxis + "\"");
}

if (yaxis != null) {
writer.write(",yaxis:\"" + yaxis + "\"");
}

if (this.disableStack) {
writer.write(",disableStack:true");
}
writer.write("}");
}

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

20 Aug 2018, 17:04

OK this is great. Can you open an issue with all the details here: https://github.com/primefaces/primefaces/issues

Then I will create a patch with your fixes for review.
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 37 guests