| Contact | FAQ | Forum | Blog | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Chart data format
Whether what type of chart you need to display, their data format is the same, which allows you to easily create a dynamic output XML formatted data server-side program. the data in forms of two-dimensional table chart data, you can understand it as a two-dimensional table, for example, the following is a typical two-dimensional form:
this two-dimensional form's XML output format is as follows:
<?xml version='1.0' encoding='utf-8'?>
<graph title="Area of sale report" column_unit="Mouth">
<row title="North America" info="">
<column title="Jan">
<data unit="US$ 1000" title="amount of sales" value="48.27" alt="US$ 48.27 thousand" info=""/>
<data unit="piece" title="volume of sales" value="50" alt="" info=""/>
</column>
<column title="Feb">
<data unit="US$ 1000" value="54.8" alt="" info=""/>
<data unit="piece" value="259" alt="" info=""/>
</column>
<column title="Mar">
<data unit="US$ 1000" value="55.82" alt="15.82ÍòÔª" info=""/>
<data unit="piece" value="168" alt="" info=""/>
</column>
<column title="Apr">
<data unit="US$ 1000" value="42.2" alt="" info=""/>
<data unit="piece" value="506" alt="" info=""/>
</column>
</row>
<row title="Asia" info="">
<column title="Jan">
<data unit="US$ 1000" value="47.2222" alt="5" info=""/>
<data unit="piece" value="231" alt="" info=""/>
</column>
<column title="Feb">
<data unit="US$ 1000" value="44.8" alt="" info=""/>
<data unit="piece" value="129" alt="" info=""/>
</column>
<column title="Mar">
<data unit="US$ 1000" value="51" alt="15.82" info=""/>
<data unit="piece" value="138" alt="" info=""/>
</column>
<column title="Apr">
<data unit="US$ 1000" value="32.2" alt="" info=""/>
<data unit="piece" value="236" alt="" info=""/>
</column>
</row>
...
</graph>
look at the corresponding between XML format with the two-dimensional table, you'll find, a <row/> tag in XML presents a row of the chart; <column/> tag is one column in the chart, and <data/> tag is a data item in the chart¡¯s lines and rows.
XML tags and attributes description
<?xml version='1.0' encoding='utf-8'?>
<graph [ title="" column_unit=""]>
<row title="" [ info=""]>
<column title="">
<data value="" unit="" title="" [ alt="" info=""]/>
</column>
</row>
</graph>
JSON data format new JSON (JavaScript Object Notation) is a lightweight data-interchange format.The DChart2.1 version adds support for JSON format, you can choose to use json or XML as the data source. Either with a return URL json or XML data as a data source, you can also assign a string or XML string json way to spread the chart component. json, xml, mapping each other, and some tools to handle this conversion. Xml format and the same, for a variety of chart types, json format is the same, such as the following XML data and the corresponding JSON code:
<?xml version='1.0' encoding='utf-8'?>
<graph title="Unit Sales" column_unit="Product">
<row title="New York" info="Jan"]>
<column title="Gym shoes" info="Gym shoes">
<data value="456" unit="Units" title="amount of sales" alt="456" info="456"/>
</column>
</row>
</graph>
{"graph":
Please note that these red square brackets, even if only a Row / column or data, also must use the "[]" expressed in the form of an array. examples of several typical data the following data has only one column (a <column/> label); it is clear that in this case, line charts and radar charts have only one point, so it should not be allowed to switch displaying charts to line charts and radar charts of no significance; this type of data only one best suited to the data shows that pie chart
Some data have the following problems: in the second line, the U.S. dollar and the euro should have a different coordinate system, not be compared together; In addition, the maximum data gap among loans rose, upfront profit and Non-performing Loans have been so large, with unobviou relationship between the contrast. Therefore, the data should not be modeled according to the charts below, but adopt the following form of "data of only one row"
3.data of only one row (amendment to the above error) The following charts¡¯ data changed the data forms of the above charts, to avoid wrong comparisons among different coordinate systems; there is only one <row/> label, and the pie chart does not make sense when there is only one row , so the displaying chart should not be allowed to switch to a pie chart without practical significance.
Sometimes we want to highlight the data of a certain row, such as in a histogram, when there are one or more rows displayed in lines or graphs, or one or more rows displayed by histogram in a lines or graph chart, this definition is closely related with the data, so the definition shall be filed in the data file (this is the only definition of attribute related to display). Dcharts 2.1 version adds the feature of dual coordinates. In the case of left main coordinate existence, the coordinate of the other dimension will be displayed at right side. A, Column chart, stacked column chart, lines chart and curve chart support dual coordinates; The dual coordinates in bar chart, pie chart, radar chart and bar stacked chart are meaningless or can not be achieved. As the chart can be switched between many types, for example, a chart adopts dual coordinates, and it is recommened that the switching range of chart should be limited in the configuration; B, For dualcoordinates, it only needs to add <linerow/> into the xml configuration file to replace <row/> . whenever <row/> is displayed properly, <linerow/> will be displayed as the right coordinate ; C, If the chart is switched to a type that does not support dual coordinates, <linerow/> will not work, and only <row/> will be displayed in the chart; D, Column and line are simultaneously displayed in non-dual coordinates: Even if the chart does not support dual coordinate, it can also be designated to be displayed as a line or a column based on the grptype property of <row> . For example, in the fourth graph at the right of sample.html, if label <linerow/> is added in the data , the original grptype property is inavailable. When the chart is a bar chart or a stacked column chart , all the data corresponding to <row/> is displayed as ?column ?and all the data corresponding to <linerow/> is displayed as line ; when the chart is a line chart or a curve chart, all the data corresponding to <linerow/> is displayed as column ?and all the data corresponding to <row/> is displayed as line . |
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2003 - 2008 OriginSoft Components Inc. All rights reserved. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||