Expand my Community achievements bar.

Don’t miss the AEM Skill Exchange in SF on Nov 14—hear from industry leaders, learn best practices, and enhance your AEM strategy with practical tips.
SOLVED

Extending OOTB Chart Component

Avatar

Former Community Member

I am trying to extend the OOTB chart component. I created a chart component with resourceSuperType = foundation/components/chart. and then created a chart.java file which is a replica of com.day.cq.wcm.foundation.chart.java and saw a int variable yawidth defined like this:

int yaWidth = "" + this.maxValue.length() * 7;

I have copied chart.jsp,img.png.java and legend.png.java on my local chart component and updated their import chart.java from my local.

With this yawidht definition my local chart component is not working. But if I define yawidth like this

int yaWidth = 100;

It starts working again. Can someone tell me whats the significance of yaWidth and why its defined like that?.

Another part is, I am trying to induce tooltips on linechart, on hovering a certain point on line it shows the value. Is there any possible way of achieving it ?

1 Accepted Solution

Avatar

Correct answer by
Level 10

What version of CQ are you using? For information about the Chart data type -- see the Java doc:

http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/foundation/Chart.html

Another option you have if extending the Chart control does not meet your needs - you can use a JQuery plugin and add that to an AEM component. We have a community article that shows this:

http://helpx.adobe.com/experience-manager/using/displaying-experience-manager-data-chart.html

View solution in original post

1 Reply

Avatar

Correct answer by
Level 10

What version of CQ are you using? For information about the Chart data type -- see the Java doc:

http://dev.day.com/docs/en/cq/current/javadoc/com/day/cq/wcm/foundation/Chart.html

Another option you have if extending the Chart control does not meet your needs - you can use a JQuery plugin and add that to an AEM component. We have a community article that shows this:

http://helpx.adobe.com/experience-manager/using/displaying-experience-manager-data-chart.html