Extending OOTB Chart Component | Community
Skip to main content
October 16, 2015
Solved

Extending OOTB Chart Component

  • October 16, 2015
  • 1 reply
  • 650 views

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 ?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by smacdonald2008

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

1 reply

smacdonald2008
smacdonald2008Accepted solution
Level 10
October 16, 2015

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