Category: | General |
Priority: | High |
Status: | Confirmed |
Project: | Severity: | Tweak |
Resolution: | Not Fixable |
|
Component: | Reproducibility: | Not Attempted |
Assigned to: |
Hey,
I have problem of creating CandleStick chart in iReport Designer. I follow these steps but in output is shown like blank chart there is
no candles is created -
1. Create report in i-report designer, select Blank A4 size report from ireport designer.
Ex:
File > New > Blank A4
(here eg.DemoOfCandlestickchart->NEXT->FINISH)
2. Delete all band except summary band
3. Goto-> Palette window tool->Select chart->Select MultiAxis chart->Select TimeSeries chart->Ok
4. Right Click on Multiaxis chart->Select Add Exist Chart->Select Candlestick chart->Ok
(add two candlestick chart into multiaxis chart)
While writing query keep in mind following things:
• For input values to Candlestick chart we require 5 values for each chart
High value
Low value
Open value
Close value
Volume value
Example:-
select
avg(0) as avg,
MAX(0) as max,
MIN(0) as min,
STDDEV(0) as std_dev,
“dummy” as _lable,
1-1-1111 as _date,
as abc from dual
· Add new Dataset ->Write query->add it
· Goto -> Report Inspector->Summary band-> Select candlestick chart (first)
->Right click on it ->Select chart data->goto chart data
Note:- Generally creating single candlestick chart first candlestick High-close value are same and second chart Low-close value are same
Please find attachment which have my output and code as shown below
and please answer me as soon as possible.
Code :
<?xml version="1.0" encoding="UTF-8"?>
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports
http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="report name"
pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20"
topMargin="20" bottomMargin="20" uuid="253d3c41-c706-413b-bb24-008ad90df4d4">
<subDataset name="dataset1" uuid="ef13dc31-927e-418e-9ea1-77dbad9cedc7">
<queryString>
<![CDATA[SELECT 'a' AS c_txt
, '2014/02/22' AS c_date
, '0.75' AS c_open
, '1.00' AS c_high
, '0.25' AS c_low
, '0.50' AS c_close
FROM DUAL;]]>
</queryString>
<field name="c_txt" class="java.lang.String"/>
<field name="c_date" class="java.util.Date"/>
<field name="c_open" class="java.lang.Double"/>
<field name="c_high" class="java.lang.Double"/>
<field name="c_low" class="java.lang.Double"/>
<field name="c_close" class="java.lang.Double"/>
</subDataset>
<background>
<band/>
</background>
<summary>
<band height="100">
<multiAxisChart>
<chart isShowLegend="true">
<reportElement
uuid="cc397ce5-1696-48f1-9f2e-dbfa7806acde" x="0" y="0" width="555" height="100"/>
<chartTitle position="Top"/>
<chartSubtitle/>
<chartLegend/>
</chart>
<multiAxisPlot>
<plot/>
<axis position="leftOrTop">
<timeSeriesChart>
<chart isShowLegend="true">
<reportElement
uuid="3d7368e5-5c9f-47bf-a7d3-91b11223f3d1" x="0" y="0" width="0" height="0"
backcolor="#FFFFFF"/>
<chartTitle
position="Top" color="#000000"/>
<chartSubtitle
color="#000000"/>
<chartLegend
textColor="#000000" backgroundColor="#FFFFFF"/>
</chart>
<timeSeriesDataset
timePeriod="Year">
<dataset>
<datasetRun
subDataset="dataset1" uuid="42d955fc-be7e-491c-a08d-2c6839ce8dba"/>
</dataset>
</timeSeriesDataset>
<timeSeriesPlot>
<plot/>
</timeSeriesPlot>
</timeSeriesChart>
</axis>
<axis>
<candlestickChart>
<chart isShowLegend="true">
<reportElement
uuid="78631e8c-fd7d-4291-b5e8-803b716baabd" x="0" y="0" width="0" height="0"
backcolor="#FFFFFF"/>
<chartTitle
position="Top" color="#000000"/>
<chartSubtitle
color="#000000"/>
<chartLegend
textColor="#000000" backgroundColor="#FFFFFF"/>
</chart>
<highLowDataset>
<dataset>
<datasetRun
subDataset="dataset1" uuid="265fbc47-8e12-4558-8d0c-bbdc47044d4e"/>
</dataset>
<seriesExpression><![CDATA[$F{c_txt}]]></seriesExpression>
<dateExpression><![CDATA[$F{c_date}]]></dateExpression>
<highExpression><![CDATA[$F{c_open}]]></highExpression>
<lowExpression><![CDATA[$F{c_low}]]></lowExpression>
<openExpression><![CDATA[$F{c_close}]]></openExpression>
<closeExpression><![CDATA[$F{c_low}]]></closeExpression>
</highLowDataset>
<candlestickPlot
isShowVolume="true">
<plot/>
</candlestickPlot>
</candlestickChart>
</axis>
</multiAxisPlot>
</multiAxisChart>
</band>
</summary>
</jasperReport>
Thanks.
2 Comments: