PageRenderTime 54ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/src/com/djbc/zkcomponent/fusion/FusionChart.java

https://bitbucket.org/tejo_ak/fuzion
Java | 1214 lines | 795 code | 162 blank | 257 comment | 76 complexity | c4d29a9ea9d8a233d8a22aef98055a70 MD5 | raw file
  1. /* FusionChart.java
  2. {{IS_NOTE
  3. Purpose:
  4. Description:
  5. History:
  6. Thu Feb 21 14:14:52 2008, Created by tomyeh
  7. }}IS_NOTE
  8. Copyright (C) 2008 Potix Corporation. All Rights Reserved.
  9. {{IS_RIGHT
  10. This program is distributed under GPL Version 2.0 in the hope that
  11. it will be useful, but WITHOUT ANY WARRANTY.
  12. }}IS_RIGHT
  13. */
  14. package com.djbc.zkcomponent.fusion;
  15. import com.djbc.utilities.StringUtil;
  16. import com.djbc.zkcomponent.fusion.model.*;
  17. import java.io.IOException;
  18. import java.util.HashMap;
  19. import java.util.Map;
  20. import org.zkoss.zk.au.AuRequest;
  21. import org.zkoss.zk.ui.event.Events;
  22. import org.zkoss.zk.ui.sys.ContentRenderer;
  23. import org.zkoss.zul.impl.XulElement;
  24. /**
  25. * @author tomyeh
  26. */
  27. public class FusionChart extends XulElement {
  28. public static String ID_PLACEHOLDER = "zkFusionCompId";
  29. public static String JS_PROXIER = "fusion.FusionChart.proxyJs";
  30. private String data;
  31. private String dateFormat;
  32. private String ganttLineAlpha;
  33. private String ganttWidthPercent;
  34. private String gridBorderColor;
  35. private String gridBorderAlpha;
  36. private String hoverCapBorderColor;
  37. private String hoverCapBgColor;
  38. private String caption = "Grafik";
  39. private String numberPrefix;
  40. private String thousand;
  41. private String decimal;
  42. private String subCaption = "";
  43. private String trendValue;
  44. private String trendName = "trend";
  45. private String xAxisName;
  46. private String yAxisName;
  47. private String PYAxisName;
  48. private String SYAxisName;
  49. private ChartTemplate chartTemplate;
  50. private boolean showValue;
  51. private String template;
  52. private String formatNumberScale;
  53. private String chartRightMargin;
  54. private String numberScaleValue;
  55. private String numberScaleUnit;
  56. private String decimalSeparator;
  57. private String thousandSeparator;
  58. private String baseFontSize;
  59. private String labelDisplay;
  60. private String numDivLines;
  61. private boolean showAlternateHGridColor;
  62. private String palette;
  63. private boolean showSum;
  64. private boolean shownames;
  65. private String alternateHGridColor;
  66. private String alternateHGridAlpha;
  67. private String divLineColor;
  68. private String divLineAlpha;
  69. private String canvasBorderColor;
  70. private String baseFontColor;
  71. private String lineColor;
  72. private String numberSuffix;
  73. private String yAxisMinValue;
  74. private String yAxisMaxValue;
  75. private String adjustDiv;
  76. private String xAxisValueDecimals;
  77. private String yAxisValueDecimals;
  78. private String decimals;
  79. private String bgColor;
  80. private String bgAlpha;
  81. private String bgRatio;
  82. private String bgAngle;
  83. private String enableSmartLabels;
  84. private String enableRotation;
  85. private boolean showBorder;
  86. private String startingAngle;
  87. private boolean showLegend;
  88. private String bgSWF;
  89. private String canvasBgAlpha;
  90. private String canvasBorderThickness;
  91. private boolean showLabels;
  92. public void setModel(SingleSeriesModel chartModel) {
  93. SingleSeriesRenderer ssr = new SingleSeriesRenderer();
  94. String sdata = ssr.getStringXMLData(chartModel);
  95. this.setData(sdata);
  96. }
  97. public void setModel(CategoryModel chartModel) {
  98. CategoryRenderer cr = new CategoryRenderer();
  99. String sdata = cr.getStringXMLData(chartModel);
  100. this.setData(sdata);
  101. }
  102. public void setModel(MSDYModel chartModel) {
  103. if (this.getChartTemplate().equals(ChartTemplate.MSStackedColumn2DLineDY)) {
  104. System.out.println("THIS IS STACKED COLUMN DY");
  105. MS2DDYRenderer dr = new MS2DDYRenderer();
  106. String sdata = dr.getStringXMLData(chartModel, new HashMap());
  107. this.setData(sdata);
  108. } else {
  109. System.out.println("THIS IS NOT STACKED COLUMN DY");
  110. MSDYRenderer dr = new MSDYRenderer();
  111. String sdata = dr.getStringXMLData(chartModel, chartModel.getSeriesParam());
  112. this.setData(sdata);
  113. }
  114. }
  115. public void setModel(GanttMonthlyModel chartModel) {
  116. GanttRenderer dr = new GanttRenderer();
  117. String sdata = dr.getStringXMLData(chartModel, new HashMap(), this);
  118. this.setData(sdata);
  119. }
  120. @Override
  121. protected void renderProperties(ContentRenderer renderer) throws IOException {
  122. ChartColor warna = ChartColor.Black;
  123. super.renderProperties(renderer);
  124. renderer.render("data", getData());
  125. renderer.render("dateFormat", getDateFormat());
  126. renderer.render("hoverCapBorderColor", getHoverCapBorderColor());
  127. renderer.render("hoverCapBgColor", getHoverCapBgColor());
  128. renderer.render("ganttWidthPercent", getGanttWidthPercent());
  129. renderer.render("ganttLineAlpha", getGanttLineAlpha());
  130. renderer.render("gridBorderColor", getDateFormat());
  131. renderer.render("gridBorderAlpha", getDateFormat());
  132. renderer.render("template", getChartTemplate().getName());
  133. renderer.render("width", getWidth());
  134. renderer.render("height", getHeight());
  135. renderer.render("divLineColor", warna.parse(getDivLineColor()));
  136. renderer.render("lineColor", warna.parse(getLineColor()));
  137. renderer.render("baseFontColor", warna.parse(getBaseFontColor()));
  138. renderer.render("divLineAlpha", warna.parse(getDivLineAlpha()));
  139. renderer.render("trendValue", getTrendValue());
  140. renderer.render("trendName", getTrendName());
  141. renderer.render("xAxisName", getxAxisName());
  142. renderer.render("yAxisName", getyAxisName());
  143. renderer.render("showValues", getShowValue());
  144. renderer.render("formatNumberScale", getFormatNumberScale());
  145. renderer.render("chartRightMargin", getChartRightMargin());
  146. renderer.render("numberScaleValue", getNumberScaleValue());
  147. renderer.render("numberScaleUnit", getNumberScaleUnit());
  148. renderer.render("decimalSeparator", getDecimalSeparator());
  149. renderer.render("thousandSeparator", getThousandSeparator());
  150. renderer.render("baseFontSize", getBaseFontSize());
  151. renderer.render("labelDisplay", getLabelDisplay());
  152. renderer.render("numDivLines", getNumDivLines());
  153. renderer.render("showAlternateHGridColor", getShowAlternateHGridColor());
  154. renderer.render("palette", getPalette());
  155. renderer.render("showSum", getShowSum());
  156. renderer.render("shownames", getShownames());
  157. renderer.render("alternateHGridColor", warna.parse(getAlternateHGridColor()));
  158. renderer.render("alternateHGridAlpha", warna.parse(getAlternateHGridAlpha()));
  159. renderer.render("canvasBorderColor", warna.parse(getCanvasBorderColor()));
  160. renderer.render("numberSuffix", getNumberSuffix());
  161. renderer.render("yAxisMinValue", getyAxisMinValue());
  162. renderer.render("yAxisMaxValue", getyAxisMaxValue());
  163. renderer.render("PYAxisName", getPYAxisName());
  164. renderer.render("SYAxisName", getSYAxisName());
  165. renderer.render("adjustDiv", getAdjustDiv());
  166. renderer.render("xAxisValueDecimals", getxAxisValueDecimals());
  167. renderer.render("yAxisValueDecimals", getyAxisValueDecimals());
  168. renderer.render("decimals", getDecimals());
  169. renderer.render("bgColor", warna.parse(getBgColor()));
  170. renderer.render("bgAlpha", getBgAlpha());
  171. renderer.render("bgRatio", getBgRatio());
  172. renderer.render("bgAngle", getBgAngle());
  173. renderer.render("enableSmartLabels", getEnableSmartLabels());
  174. renderer.render("enableRotation", getEnableRotation());
  175. renderer.render("showBorder", getShowBorder());
  176. renderer.render("startingAngle", getStartingAngle());
  177. renderer.render("showLegend", getShowLegend());
  178. renderer.render("showLabels", getShowLegend());
  179. }
  180. private String renderChartTag(String chartData) {
  181. String trend = "";
  182. ChartColor warna = ChartColor.Black;
  183. Map p = new HashMap();
  184. p.put("caption", getCaption());
  185. p.put("subCaption", getSubCaption());
  186. if (!StringUtil.isNullOrEmpty(xAxisName)) {
  187. p.put("xAxisName", getxAxisName());//
  188. }
  189. if (!StringUtil.isNullOrEmpty(dateFormat)) {
  190. p.put("dateFormat", getDateFormat());//
  191. }
  192. if (!StringUtil.isNullOrEmpty(PYAxisName)) {
  193. p.put("PYAxisName", getPYAxisName());//
  194. }
  195. if (!StringUtil.isNullOrEmpty(SYAxisName)) {
  196. p.put("SYAxisName", getSYAxisName());//
  197. }
  198. if (!StringUtil.isNullOrEmpty(yAxisName)) {
  199. p.put("yAxisName", getyAxisName());//
  200. }
  201. if (!StringUtil.isNullOrEmpty(trendValue)) {
  202. Map tr = new HashMap();
  203. tr.put("startValue", getTrendValue());
  204. tr.put("displayValue", getTrendName());
  205. tr.put("valueOnRight", "1");
  206. trend = ChartUtil.noding("trendLines", ChartUtil.noding("line", tr));
  207. }//
  208. if (!StringUtil.isNullOrEmpty(thousand)) {
  209. p.put("inThousandSeparator", getThousand());//
  210. }
  211. if (!StringUtil.isNullOrEmpty(decimal)) {
  212. p.put("inDecimalSeparator", getDecimal());//
  213. }
  214. if (getShowValue()) {
  215. p.put("showValues", "1");//
  216. } else {
  217. p.put("showValues", "0");//
  218. }
  219. if (getShowSum()) {
  220. p.put("ShowSum", "1");//
  221. } else {
  222. p.put("ShowSum", "0");//
  223. }
  224. if (getShownames()) {
  225. p.put("Shownames", "1");//
  226. } else {
  227. p.put("Shownames", "0");//
  228. }
  229. if (!StringUtil.isNullOrEmpty(chartRightMargin)) {
  230. p.put("chartRightMargin", getChartRightMargin());//
  231. }
  232. if (!StringUtil.isNullOrEmpty(formatNumberScale)) {
  233. p.put("formatNumberScale", getFormatNumberScale());//
  234. }
  235. if (!StringUtil.isNullOrEmpty(numberScaleValue)) {
  236. p.put("numberScaleValue", getNumberScaleValue());//
  237. } else {
  238. p.put("numberScaleValue", "1000,1000,1000,1000");
  239. }
  240. if (!StringUtil.isNullOrEmpty(numberScaleUnit)) {
  241. p.put("numberScaleUnit", getNumberScaleUnit());//
  242. } else {
  243. p.put("numberScaleUnit", "R, J, M, T");
  244. }
  245. if (!StringUtil.isNullOrEmpty(decimalSeparator)) {
  246. p.put("decimalSeparator", getDecimalSeparator());//
  247. }
  248. if (!StringUtil.isNullOrEmpty(thousandSeparator)) {
  249. p.put("thousandSeparator", getThousandSeparator());//
  250. }
  251. if (!StringUtil.isNullOrEmpty(baseFontSize)) {
  252. p.put("baseFontSize", getBaseFontSize());//
  253. }
  254. if (!StringUtil.isNullOrEmpty(labelDisplay)) {
  255. p.put("labelDisplay", getLabelDisplay());//
  256. }
  257. if (!StringUtil.isNullOrEmpty(numDivLines)) {
  258. p.put("numDivLines", getNumDivLines());//
  259. }
  260. p.put("ShowAlternateHGridColor", getShowAlternateHGridColor() ? "1" : "0");//
  261. p.put("showLabels", getShowLabels() ? "1" : "0");//
  262. if (!StringUtil.isNullOrEmpty(palette)) {
  263. p.put("palette", getPalette());//
  264. }
  265. if (!StringUtil.isNullOrEmpty(alternateHGridColor)) {
  266. p.put("alternateHGridColor", warna.parse(getAlternateHGridColor()));//
  267. } else {
  268. p.put("alternateHGridColor", "FCB541");//
  269. }
  270. if (!StringUtil.isNullOrEmpty(alternateHGridAlpha)) {
  271. p.put("alternateHGridAlpha", (getAlternateHGridAlpha()));//
  272. } else {
  273. p.put("alternateHGridAlpha", "20");
  274. }
  275. if (!StringUtil.isNullOrEmpty(divLineColor)) {
  276. p.put("divLineColor", warna.parse(getDivLineColor()));//
  277. } else {
  278. p.put("divLineColor", "FCB541");
  279. }
  280. if (!StringUtil.isNullOrEmpty(divLineAlpha)) {
  281. p.put("divLineAlpha", getDivLineAlpha());//
  282. } else {
  283. p.put("divLineAlpha", "50");
  284. }
  285. if (!StringUtil.isNullOrEmpty(canvasBorderColor)) {
  286. p.put("canvasBorderColor", warna.parse(getCanvasBorderColor()));//
  287. } else {
  288. p.put("canvasBorderColor", "666666");
  289. }
  290. if (!StringUtil.isNullOrEmpty(baseFontColor)) {
  291. p.put("baseFontColor", warna.parse(getBaseFontColor()));//
  292. } else {
  293. p.put("baseFontColor", "666666");//
  294. }
  295. if (!StringUtil.isNullOrEmpty(lineColor)) {
  296. p.put("lineColor", warna.parse(getLineColor()));//
  297. } else {
  298. p.put("lineColor", "FCB541");
  299. }
  300. if (!StringUtil.isNullOrEmpty(numberSuffix)) {
  301. p.put("numberSuffix", getNumberSuffix());//
  302. }
  303. if (!StringUtil.isNullOrEmpty(yAxisMinValue)) {
  304. p.put("yAxisMinValue", getyAxisMinValue());//
  305. }
  306. if (!StringUtil.isNullOrEmpty(yAxisMaxValue)) {
  307. p.put("yAxisMaxValue", getyAxisMaxValue());//
  308. }
  309. if (!StringUtil.isNullOrEmpty(adjustDiv)) {
  310. p.put("adjustDiv", getAdjustDiv());//
  311. }
  312. if (!StringUtil.isNullOrEmpty(xAxisValueDecimals)) {
  313. p.put("xAxisValueDecimals", getxAxisValueDecimals());//
  314. }
  315. if (!StringUtil.isNullOrEmpty(yAxisValueDecimals)) {
  316. p.put("yAxisValueDecimals", getyAxisValueDecimals());//
  317. }
  318. if (!StringUtil.isNullOrEmpty(decimals)) {
  319. p.put("decimals", getDecimals());//
  320. }
  321. if (!StringUtil.isNullOrEmpty(bgColor)) {
  322. p.put("bgColor", warna.parse(getBgColor()));//
  323. } else {
  324. p.put("bgColor", "99CCFF,FFFFFF");
  325. }
  326. if (!StringUtil.isNullOrEmpty(bgAlpha)) {
  327. p.put("bgAlpha", (getBgAlpha()));//
  328. } else {
  329. p.put("bgAlpha", "40,100");
  330. }
  331. if (!StringUtil.isNullOrEmpty(bgRatio)) {
  332. p.put("bgRatio", (getBgRatio()));//
  333. } else {
  334. p.put("bgRatio", "0,100");
  335. }
  336. if (!StringUtil.isNullOrEmpty(bgAngle)) {
  337. p.put("bgAngle", (getBgAngle()));//
  338. } else {
  339. p.put("bgAngle", "360");
  340. }
  341. if (getShowBorder()) {
  342. p.put("showBorder", ("1"));//
  343. } else {
  344. p.put("showBorder", "0");
  345. }
  346. if (!StringUtil.isNullOrEmpty(startingAngle)) {
  347. p.put("startingAngle", (getStartingAngle()));//
  348. } else {
  349. p.put("startingAngle", "45");
  350. }
  351. if (!StringUtil.isNullOrEmpty(enableSmartLabels)) {
  352. p.put("enableSmartLabels", (getEnableSmartLabels()));//
  353. } else {
  354. p.put("enableSmartLabels", "1");
  355. }
  356. if (!StringUtil.isNullOrEmpty(enableRotation)) {
  357. p.put("enableRotation", (getEnableRotation()));//
  358. } else {
  359. p.put("enableRotation", "1");
  360. }
  361. if (getShowLegend()) {
  362. p.put("showLegend", "1");//
  363. } else {
  364. p.put("showLegend", "0");
  365. }
  366. if (!StringUtil.isNullOrEmpty(bgSWF)) {
  367. p.put("bgSWF", (getBgSWF()));//
  368. }
  369. if (!StringUtil.isNullOrEmpty(canvasBgAlpha)) {
  370. p.put("canvasBgAlpha", (getCanvasBgAlpha()));//
  371. } else {
  372. p.put("canvasBgAlpha", "30");
  373. }
  374. if (!StringUtil.isNullOrEmpty(canvasBorderThickness)) {
  375. p.put("canvasBorderThickness", (getCanvasBorderThickness()));//
  376. } else {
  377. p.put("canvasBorderThickness", "0");
  378. }
  379. return ChartUtil.noding("chart", p, chartData + trend);
  380. }
  381. public String getDateFormat() {
  382. return dateFormat;
  383. }
  384. public void setDateFormat(String dateFormat) {
  385. this.dateFormat = dateFormat;
  386. }
  387. public String getDecimal() {
  388. return decimal;
  389. }
  390. public void setDecimal(String decimal) {
  391. this.decimal = decimal;
  392. }
  393. public String getNumberPrefix() {
  394. return numberPrefix;
  395. }
  396. public void setNumberPrefix(String numberPrefix) {
  397. this.numberPrefix = numberPrefix;
  398. }
  399. public boolean isShowValue() {
  400. return getShowValue();
  401. }
  402. public void setShowValue(boolean showValue) {
  403. this.setShowValue((Boolean) showValue);
  404. }
  405. public String getSubCaption() {
  406. return subCaption;
  407. }
  408. public void setSubCaption(String subCaption) {
  409. this.subCaption = subCaption;
  410. }
  411. public String getThousand() {
  412. return thousand;
  413. }
  414. public void setThousand(String thousand) {
  415. this.thousand = thousand;
  416. }
  417. public String getTrendName() {
  418. return trendName;
  419. }
  420. public void setTrendName(String trendName) {
  421. this.trendName = trendName;
  422. }
  423. public String getTrendValue() {
  424. return trendValue;
  425. }
  426. public void setTrendValue(String trendValue) {
  427. this.trendValue = trendValue;
  428. }
  429. public String getXAxisName() {
  430. return getxAxisName();
  431. }
  432. public void setXAxisName(String xAxisName) {
  433. this.setxAxisName(xAxisName);
  434. }
  435. public String getYAxisName() {
  436. return getyAxisName();
  437. }
  438. public void setYAxisName(String yAxisName) {
  439. this.setyAxisName(yAxisName);
  440. }
  441. public String getCaption() {
  442. return caption;
  443. }
  444. public void setCaption(String caption) {
  445. this.caption = caption;
  446. }
  447. public void setData(String data) {
  448. data = data.replaceAll(ID_PLACEHOLDER, getUuid());
  449. this.data = renderChartTag(data);
  450. System.out.println("isi data : " + this.data);
  451. smartUpdate("data", this.data);
  452. }
  453. public String getData() {
  454. return data;
  455. }
  456. /**
  457. * merender attribut pada <chart atrributes>.... data ....</chart>
  458. *
  459. * @return
  460. */
  461. public ChartTemplate getChartTemplate() {
  462. return chartTemplate;
  463. }
  464. public void setChartTemplate(ChartTemplate chartTemplate) {
  465. //chartTemplate = chartTemplate.replaceAll(ID_PLACEHOLDER, getUuid());
  466. //String tpl= "template = '" + renderChartTag(chartTemplate.getName()) + "'";
  467. //System.out.println(this.data);
  468. //smartUpdate("template", tpl);
  469. this.chartTemplate = chartTemplate;
  470. smartUpdate("template", this.chartTemplate.getName());
  471. }
  472. public String getTemplate() {
  473. return getChartTemplate().getName() + ".swf?ChartNoDataText=Tidak ada data";
  474. }
  475. public void setTemplate(String template) {
  476. if (template.indexOf(".swf") == -1) {
  477. template = template.replaceAll(".swf", "");
  478. }
  479. this.template = template;
  480. this.setChartTemplate(ChartTemplate.parse(template));
  481. }
  482. public String getxAxisName() {
  483. return xAxisName;
  484. }
  485. public void setxAxisName(String xAxisName) {
  486. this.xAxisName = xAxisName;
  487. }
  488. public String getyAxisName() {
  489. return yAxisName;
  490. }
  491. public void setyAxisName(String yAxisName) {
  492. this.yAxisName = yAxisName;
  493. }
  494. public Boolean getShowValue() {
  495. return showValue;
  496. }
  497. public void setShowValue(Boolean showValue) {
  498. this.showValue = showValue;
  499. }
  500. public String getFormatNumberScale() {
  501. return formatNumberScale;
  502. }
  503. public void setFormatNumberScale(String formatNumberScale) {
  504. this.formatNumberScale = formatNumberScale;
  505. }
  506. public String getChartRightMargin() {
  507. return chartRightMargin;
  508. }
  509. public void setChartRightMargin(String chartRightMargin) {
  510. this.chartRightMargin = chartRightMargin;
  511. }
  512. public String getNumberScaleValue() {
  513. return numberScaleValue;
  514. }
  515. /**
  516. * @param numberScaleValue the numberScaleValue to set
  517. */
  518. public void setNumberScaleValue(String numberScaleValue) {
  519. this.numberScaleValue = numberScaleValue;
  520. }
  521. /**
  522. * @return the numberScaleUnit
  523. */
  524. public String getNumberScaleUnit() {
  525. return numberScaleUnit;
  526. }
  527. /**
  528. * @param numberScaleUnit the numberScaleUnit to set
  529. */
  530. public void setNumberScaleUnit(String numberScaleUnit) {
  531. this.numberScaleUnit = numberScaleUnit;
  532. }
  533. /**
  534. * @return the decimalSeparator
  535. */
  536. public String getDecimalSeparator() {
  537. return decimalSeparator;
  538. }
  539. /**
  540. * @param decimalSeparator the decimalSeparator to set
  541. */
  542. public void setDecimalSeparator(String decimalSeparator) {
  543. this.decimalSeparator = decimalSeparator;
  544. }
  545. /**
  546. * @return the thousandSeparator
  547. */
  548. public String getThousandSeparator() {
  549. return thousandSeparator;
  550. }
  551. /**
  552. * @param thousandSeparator the thousandSeparator to set
  553. */
  554. public void setThousandSeparator(String thousandSeparator) {
  555. this.thousandSeparator = thousandSeparator;
  556. }
  557. /**
  558. * @return the baseFontSize
  559. */
  560. public String getBaseFontSize() {
  561. return baseFontSize;
  562. }
  563. /**
  564. * @param baseFontSize the baseFontSize to set
  565. */
  566. public void setBaseFontSize(String baseFontSize) {
  567. this.baseFontSize = baseFontSize;
  568. }
  569. /**
  570. * @return the labelDisplay
  571. */
  572. public String getLabelDisplay() {
  573. return labelDisplay;
  574. }
  575. /**
  576. * @param labelDisplay the labelDisplay to set
  577. */
  578. public void setLabelDisplay(String labelDisplay) {
  579. this.labelDisplay = labelDisplay;
  580. }
  581. /**
  582. * @return the numDivLines
  583. */
  584. public String getNumDivLines() {
  585. return numDivLines;
  586. }
  587. /**
  588. * @param numDivLines the numDivLines to set
  589. */
  590. public void setNumDivLines(String numDivLines) {
  591. this.numDivLines = numDivLines;
  592. }
  593. /**
  594. * @return the showAlternateHGridColor
  595. */
  596. public Boolean getShowAlternateHGridColor() {
  597. return showAlternateHGridColor;
  598. }
  599. /**
  600. * @param showAlternateHGridColor the showAlternateHGridColor to set
  601. */
  602. public void setShowAlternateHGridColor(Boolean showAlternateHGridColor) {
  603. this.showAlternateHGridColor = showAlternateHGridColor;
  604. }
  605. /**
  606. * @return the palette
  607. */
  608. public String getPalette() {
  609. return palette;
  610. }
  611. /**
  612. * @param palette the palette to set
  613. */
  614. public void setPalette(String palette) {
  615. this.palette = palette;
  616. }
  617. /**
  618. * @return the showSum
  619. */
  620. public Boolean getShowSum() {
  621. return showSum;
  622. }
  623. /**
  624. * @param showSum the showSum to set
  625. */
  626. public void setShowSum(Boolean showSum) {
  627. this.showSum = showSum;
  628. }
  629. /**
  630. * @return the shownames
  631. */
  632. public Boolean getShownames() {
  633. return shownames;
  634. }
  635. /**
  636. * @param shownames the shownames to set
  637. */
  638. public void setShownames(Boolean shownames) {
  639. this.shownames = shownames;
  640. }
  641. /**
  642. * @return the alternateHGridColor
  643. */
  644. public String getAlternateHGridColor() {
  645. return alternateHGridColor;
  646. }
  647. /**
  648. * @param alternateHGridColor the alternateHGridColor to set
  649. */
  650. public void setAlternateHGridColor(String alternateHGridColor) {
  651. this.alternateHGridColor = alternateHGridColor;
  652. }
  653. /**
  654. * @return the alternateHGridAlpha
  655. */
  656. public String getAlternateHGridAlpha() {
  657. return alternateHGridAlpha;
  658. }
  659. /**
  660. * @param alternateHGridAlpha the alternateHGridAlpha to set
  661. */
  662. public void setAlternateHGridAlpha(String alternateHGridAlpha) {
  663. this.alternateHGridAlpha = alternateHGridAlpha;
  664. }
  665. /**
  666. * @return the divLineColor
  667. */
  668. public String getDivLineColor() {
  669. return divLineColor;
  670. }
  671. /**
  672. * @param divLineColor the divLineColor to set
  673. */
  674. public void setDivLineColor(String divLineColor) {
  675. this.divLineColor = divLineColor;
  676. }
  677. /**
  678. * @return the divLineAlpha
  679. */
  680. public String getDivLineAlpha() {
  681. return divLineAlpha;
  682. }
  683. /**
  684. * @param divLineAlpha the divLineAlpha to set
  685. */
  686. public void setDivLineAlpha(String divLineAlpha) {
  687. this.divLineAlpha = divLineAlpha;
  688. }
  689. /**
  690. * @return the canvasBorderColor
  691. */
  692. public String getCanvasBorderColor() {
  693. return canvasBorderColor;
  694. }
  695. /**
  696. * @param canvasBorderColor the canvasBorderColor to set
  697. */
  698. public void setCanvasBorderColor(String canvasBorderColor) {
  699. this.canvasBorderColor = canvasBorderColor;
  700. }
  701. /**
  702. * @return the baseFontColor
  703. */
  704. public String getBaseFontColor() {
  705. return baseFontColor;
  706. }
  707. /**
  708. * @param baseFontColor the baseFontColor to set
  709. */
  710. public void setBaseFontColor(String baseFontColor) {
  711. this.baseFontColor = baseFontColor;
  712. }
  713. /**
  714. * @return the lineColor
  715. */
  716. public String getLineColor() {
  717. return lineColor;
  718. }
  719. /**
  720. * @param lineColor the lineColor to set
  721. */
  722. public void setLineColor(String lineColor) {
  723. this.lineColor = lineColor;
  724. }
  725. /**
  726. * @return the numberSuffix
  727. */
  728. public String getNumberSuffix() {
  729. return numberSuffix;
  730. }
  731. /**
  732. * @param numberSuffix the numberSuffix to set
  733. */
  734. public void setNumberSuffix(String numberSuffix) {
  735. this.numberSuffix = numberSuffix;
  736. }
  737. /**
  738. * @return the yAxisMinValue
  739. */
  740. public String getyAxisMinValue() {
  741. return yAxisMinValue;
  742. }
  743. /**
  744. * @param yAxisMinValue the yAxisMinValue to set
  745. */
  746. public void setyAxisMinValue(String yAxisMinValue) {
  747. this.yAxisMinValue = yAxisMinValue;
  748. }
  749. /**
  750. * @return the yAxisMaxValue
  751. */
  752. public String getyAxisMaxValue() {
  753. return yAxisMaxValue;
  754. }
  755. /**
  756. * @param yAxisMaxValue the yAxisMaxValue to set
  757. */
  758. public void setyAxisMaxValue(String yAxisMaxValue) {
  759. this.yAxisMaxValue = yAxisMaxValue;
  760. }
  761. /**
  762. * @return the adjustDiv
  763. */
  764. public String getAdjustDiv() {
  765. return adjustDiv;
  766. }
  767. /**
  768. * @param adjustDiv the adjustDiv to set
  769. */
  770. public void setAdjustDiv(String adjustDiv) {
  771. this.adjustDiv = adjustDiv;
  772. }
  773. /**
  774. * @return the xAxisValueDecimals
  775. */
  776. public String getxAxisValueDecimals() {
  777. return xAxisValueDecimals;
  778. }
  779. /**
  780. * @param xAxisValueDecimals the xAxisValueDecimals to set
  781. */
  782. public void setxAxisValueDecimals(String xAxisValueDecimals) {
  783. this.xAxisValueDecimals = xAxisValueDecimals;
  784. }
  785. /**
  786. * @return the yAxisValueDecimals
  787. */
  788. public String getyAxisValueDecimals() {
  789. return yAxisValueDecimals;
  790. }
  791. /**
  792. * @param yAxisValueDecimals the yAxisValueDecimals to set
  793. */
  794. public void setyAxisValueDecimals(String yAxisValueDecimals) {
  795. this.yAxisValueDecimals = yAxisValueDecimals;
  796. }
  797. /**
  798. * @return the decimals
  799. */
  800. public String getDecimals() {
  801. return decimals;
  802. }
  803. /**
  804. * @param decimals the decimals to set
  805. */
  806. public void setDecimals(String decimals) {
  807. this.decimals = decimals;
  808. }
  809. /**
  810. * @return the bgColor
  811. */
  812. public String getBgColor() {
  813. return bgColor;
  814. }
  815. /**
  816. * @param bgColor the bgColor to set
  817. */
  818. public void setBgColor(String bgColor) {
  819. this.bgColor = bgColor;
  820. }
  821. /**
  822. * @return the bgAlpha
  823. */
  824. public String getBgAlpha() {
  825. return bgAlpha;
  826. }
  827. /**
  828. * @param bgAlpha the bgAlpha to set
  829. */
  830. public void setBgAlpha(String bgAlpha) {
  831. this.bgAlpha = bgAlpha;
  832. }
  833. /**
  834. * @return the bgRatio
  835. */
  836. public String getBgRatio() {
  837. return bgRatio;
  838. }
  839. /**
  840. * @param bgRatio the bgRatio to set
  841. */
  842. public void setBgRatio(String bgRatio) {
  843. this.bgRatio = bgRatio;
  844. }
  845. /**
  846. * @return the bgAngle
  847. */
  848. public String getBgAngle() {
  849. return bgAngle;
  850. }
  851. /**
  852. * @param bgAngle the bgAngle to set
  853. */
  854. public void setBgAngle(String bgAngle) {
  855. this.bgAngle = bgAngle;
  856. }
  857. /**
  858. * @return the enableSmartLabels
  859. */
  860. public String getEnableSmartLabels() {
  861. return enableSmartLabels;
  862. }
  863. /**
  864. * @param enableSmartLabels the enableSmartLabels to set
  865. */
  866. public void setEnableSmartLabels(String enableSmartLabels) {
  867. this.enableSmartLabels = enableSmartLabels;
  868. }
  869. /**
  870. * @return the enableRotation
  871. */
  872. public String getEnableRotation() {
  873. return enableRotation;
  874. }
  875. /**
  876. * @param enableRotation the enableRotation to set
  877. */
  878. public void setEnableRotation(String enableRotation) {
  879. this.enableRotation = enableRotation;
  880. }
  881. /**
  882. * @return the showBorder
  883. */
  884. public boolean getShowBorder() {
  885. return showBorder;
  886. }
  887. /**
  888. * @param showBorder the showBorder to set
  889. */
  890. public void setShowBorder(boolean showBorder) {
  891. this.showBorder = showBorder;
  892. }
  893. /**
  894. * @return the startingAngle
  895. */
  896. public String getStartingAngle() {
  897. return startingAngle;
  898. }
  899. /**
  900. * @param startingAngle the startingAngle to set
  901. */
  902. public void setStartingAngle(String startingAngle) {
  903. this.startingAngle = startingAngle;
  904. }
  905. /**
  906. * @return the showLegend
  907. */
  908. public boolean getShowLegend() {
  909. return showLegend;
  910. }
  911. /**
  912. * @param showLegend the showLegend to set
  913. */
  914. public void setShowLegend(boolean showLegend) {
  915. this.showLegend = showLegend;
  916. }
  917. /**
  918. * @return the bgSWF
  919. */
  920. public String getBgSWF() {
  921. return bgSWF;
  922. }
  923. /**
  924. * @param bgSWF the bgSWF to set
  925. */
  926. public void setBgSWF(String bgSWF) {
  927. this.bgSWF = bgSWF;
  928. }
  929. /**
  930. * @return the canvasBgAlpha
  931. */
  932. public String getCanvasBgAlpha() {
  933. return canvasBgAlpha;
  934. }
  935. /**
  936. * @param canvasBgAlpha the canvasBgAlpha to set
  937. */
  938. public void setCanvasBgAlpha(String canvasBgAlpha) {
  939. this.canvasBgAlpha = canvasBgAlpha;
  940. }
  941. /**
  942. * @return the canvasBorderThickness
  943. */
  944. public String getCanvasBorderThickness() {
  945. return canvasBorderThickness;
  946. }
  947. /**
  948. * @param canvasBorderThickness the canvasBorderThickness to set
  949. */
  950. public void setCanvasBorderThickness(String canvasBorderThickness) {
  951. this.canvasBorderThickness = canvasBorderThickness;
  952. }
  953. /**
  954. * @return the showLabels
  955. */
  956. public boolean getShowLabels() {
  957. return showLabels;
  958. }
  959. /**
  960. * @param showLabels the showLabels to set
  961. */
  962. public void setShowLabels(boolean showLabels) {
  963. this.showLabels = showLabels;
  964. }
  965. public String getPYAxisName() {
  966. return PYAxisName;
  967. }
  968. public void setPYAxisName(String PYAxisName) {
  969. this.PYAxisName = PYAxisName;
  970. }
  971. public String getSYAxisName() {
  972. return SYAxisName;
  973. }
  974. public void setSYAxisName(String SYAxisName) {
  975. this.SYAxisName = SYAxisName;
  976. }
  977. public boolean isShowAlternateHGridColor() {
  978. return showAlternateHGridColor;
  979. }
  980. public void setShowAlternateHGridColor(boolean showAlternateHGridColor) {
  981. this.showAlternateHGridColor = showAlternateHGridColor;
  982. }
  983. public boolean isShowSum() {
  984. return showSum;
  985. }
  986. public void setShowSum(boolean showSum) {
  987. this.showSum = showSum;
  988. }
  989. public boolean isShownames() {
  990. return shownames;
  991. }
  992. public void setShownames(boolean shownames) {
  993. this.shownames = shownames;
  994. }
  995. public String getGanttLineAlpha() {
  996. return ganttLineAlpha;
  997. }
  998. public void setGanttLineAlpha(String ganttLineAlpha) {
  999. this.ganttLineAlpha = ganttLineAlpha;
  1000. }
  1001. public String getGanttWidthPercent() {
  1002. return ganttWidthPercent;
  1003. }
  1004. public void setGanttWidthPercent(String ganttWidthPercent) {
  1005. this.ganttWidthPercent = ganttWidthPercent;
  1006. }
  1007. public String getGridBorderAlpha() {
  1008. return gridBorderAlpha;
  1009. }
  1010. public void setGridBorderAlpha(String gridBorderAlpha) {
  1011. this.gridBorderAlpha = gridBorderAlpha;
  1012. }
  1013. public String getGridBorderColor() {
  1014. return gridBorderColor;
  1015. }
  1016. public void setGridBorderColor(String gridBorderColor) {
  1017. this.gridBorderColor = gridBorderColor;
  1018. }
  1019. public String getHoverCapBgColor() {
  1020. return hoverCapBgColor;
  1021. }
  1022. public void setHoverCapBgColor(String hoverCapBgColor) {
  1023. this.hoverCapBgColor = hoverCapBgColor;
  1024. }
  1025. public String getHoverCapBorderColor() {
  1026. return hoverCapBorderColor;
  1027. }
  1028. public void setHoverCapBorderColor(String hoverCapBorderColor) {
  1029. this.hoverCapBorderColor = hoverCapBorderColor;
  1030. }
  1031. @Override
  1032. public void service(AuRequest request, boolean everError) {
  1033. String cmd = request.getCommand();
  1034. // System.out.println("do some thing here from service item");
  1035. if (cmd.equals("onItemClick")) {
  1036. Map data = request.getData();
  1037. Events.postEvent("onItemClick", this, data);
  1038. } else {
  1039. super.service(request, everError);
  1040. }
  1041. }
  1042. static {
  1043. String s = Events.ON_BLUR;
  1044. // System.out.println("blur event = " + s);
  1045. addClientEvent(FusionChart.class, "onItemClick", 0);
  1046. }
  1047. }