Candlestick Chart > XML Examples |
In this part of the document, we'll see some examples of candlestick charts and their corresponding XML data. |
3 month data without specifying the xIndex |
In this XML document, we'll see a 3 months continuous data without a xIndex for any <set> value. The XML document for this example looks as under: |
<graph caption='3 Months - As on 04/02/04' yAxisMinValue='24'
yAxisMaxValue='29' canvasBorderColor='DAE1E8' canvasBgColor='FFFFFF' bgColor='EEF2FB'
numDivLines='9' divLineColor='DAE1E8' decimalPrecision='2' numberPrefix='$'
showNames='1' bearBorderColor='E33C3C' bearFillColor='E33C3C' bullBorderColor='1F3165'
baseFontColor='444C60' outCnvBaseFontColor='444C60' hoverCapBorderColor='DAE1E8'
hoverCapBgColor='FFFFFF' rotateNames='0'> <categories font='' fontSize='10'
fontColor='' verticalLineColor='' verticalLineThickness='1' verticalLineAlpha='100'> </data> |
And the chart would look as under: |
As you can see above, FusionCharts has automatically numbered the <set> in the same order in which it is present in the XML document. That is, the category label with xIndex as 1 is appearing at the beginning of the chart. |
15 days data with xIndex and a missing data |
In this XML document, we'll see the data for 15 days which have an xIndex specified for each <set> element. We'll also see how to cope with missing data - for example, we have set a missing data here with caption as holiday. Apart from that, we've also hightlighted one particular candle using contrast colors. Also, in this example, you can see how to use category names and lines (with exact xIndex specified) to denote items such as Split, Dividend etc. The XML looks as under: |
<graph caption='Past 15 days' yaXisMinValue='89'
yaXisMaxValue='102' canvasBorderColor='DAE1E8' canvasBgColor='FFFFFF' bgColor='EEF2FB'
numDivLines='12' divLineColor='DAE1E8' decimalPrecision='1' numberPrefix='$'
showNames='1' bearBorderColor='E33C3C' bearFillColor='E33C3C' bullBorderColor='1F3165'
baseFontColor='444C60' outCnvBaseFontColor='444C60' hoverCapBorder='DAE1E8'
hoverCapBg='FFFFFF' rotateNames='0' candleWidth='5'> <categories
font='' fontSize='10' fontColor='' verticalLineColor='' verticalLineThickness='1'
verticalLineAlpha='100'> |
And the chart output looks as under: |
To convert the above chart to a stock bar chart, we just add showAsBars="1" attribute to the <graph> element, and get the following output: |