Monday, 2 February 2015

Create dhtmlxchart line series with xAxis as muti value



i would try to create chart using dhtmlxchart of Depth of drill from various duration data. But Depth is yAxis and multi series duration data is xAxis.


How to do that ?



var chart1 = cBox.attachChart({
view :"line",
container: "chart_div",
value: "#Depth#",
line: {
color: "#3399ff",
width: 3
},
xAxis: {
title: "Duration, days",
template: "#Avg#"
},
yAxis: {
start: 0,
end: 5000,
step: 250,
title: "Depth, m"
}
});

chart1.addSeries({
value : "#Depth#",
line: {
color : "#99ff33",
width : 3
},
xAxis: {
template: "#P90#"
},
});

chart1.parse(hdrChart);


and the value of hdrChart is :



"<data>
<item id="1"> <Avg>0.899</Avg> <P90>3.887</P90><Depth>135</Depth> </item>
<item id="2"> <Avg>3.981</Avg> <P90>15.845</P90> <Depth>1550.0</Depth></item>
<item id="3"><Avg>5.563</Avg> <P90>22.219</P90> <Depth>1550.0</Depth> </item>
<item id="4"> <Avg>9.364</Avg><P90>44.849</P90> <Depth>4059.0</Depth> </item>
<item id="5"> <Avg>9.023</Avg><P90>43.939</P90> <Depth>4059.0</Depth> </item>
<item id="6"> <Avg>10.919</Avg><P90>54.814</P90> <Depth>4059.0</Depth> </item>
<item id="7"> <Avg>14.803</Avg><P90>76.578</P90> <Depth>4473.0</Depth> </item>
<item id="8"> <Avg>15.691</Avg><P90>79.939</P90> <Depth>4473.0</Depth> </item>
<item id="9"> <Avg>17.235</Avg><P90>86.544</P90> <Depth>4473.0</Depth> </item>
<item id="10"> <Avg>18.264</Avg><P90>88.872</P90> <Depth>4473.0</Depth> </item> </data>"


Only p90 drawn.


No comments:

Post a Comment