Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Hadoop Wiki" for change 
notification.

The following page has been changed by TerenceKwan:
http://wiki.apache.org/hadoop/Chukwa_Console_Integration_Guide

------------------------------------------------------------------------------
  (*** TODO ***)
  
  === Charting Widget Component ===
- (*** TODO ***)
+ (*** TODO *** Need to provide more detail and/or more example for this)
+ 
+ In order to use the chart component, you need to create a dataMap variable 
and put the graph data information inside it. Then call the Chart component to 
draw the chart.
+ 
+ A good example is in: 
'''chukwa-0.1/src/web/hicc/jsp/single-series-chart-javascript.jsp'''. Inside 
the jsp file, it will open the database and read the data and call the Chart 
component and return the chart to the front end.
+ 
+ You can get your data from rest API or database, then call the Chart as below 
and return the object to the front end. (TODO: need to link to the Javadoc of 
the Chart component.)
+ 
+ {{{
+        if(dataMap.size()!=0) {
+            if(request.getParameter("render")!=null) {
+                render=xf.getParameter("render");
+            }
+            Chart c = new Chart(request);           
+            c.setYAxisLabels(false);
+            if(request.getParameter("x_label")!=null && 
xf.getParameter("x_label").equals("on")) {
+                c.setXAxisLabels(true);
+            } else {
+                c.setXAxisLabels(false);
+            }
+            c.setYAxisLabel("");
+            if(request.getParameter("x_axis_label")!=null) {
+                c.setXAxisLabel(xf.getParameter("x_axis_label"));
+            } else {
+                c.setXAxisLabel("Time");
+            }
+            if(title!=null) {
+                c.setTitle(title);
+            } else {
+                c.setTitle(metrics.toString());
+            }
+            if(request.getParameter("y_axis_max")!=null) {
+                double max = Double.parseDouble(xf.getParameter("y_axis_max"));
+                c.setYMax(max);
+            }
+            if(request.getParameter("legend")!=null && 
xf.getParameter("legend").equals("off")) {
+                c.setLegend(false);
+            }
+            c.setGraphType(graphType);
+            c.setXLabelsRange(labels);
+            c.setSize(width,height);
+            c.setDataSet(render,dataMap);
+            out.println(c.plot());
+         }
+ }}}
  
  === Target Widget Component ===
  (*** TODO ***)

Reply via email to