我收到以下解析错误。我知道 javascript 代码有效,因为我已经用静态 JsonStore 替换了 xml 集成。你能发现我做错了什么吗?
提前感谢您的任何建议。
Error: Problem parsing d="L790,518.887301636L120,518.887301636Z" results-graph3.htm:1111
Error: Problem parsing d="Z"
XML 文件:
<?xml version="1.0" encoding="utf-8"?>
<fundGrowthData>
<growthData>
<Year>1991</Year>
<asOfDate>December 31, 1991</asOfDate>
<Dividends>10000</Dividends>
<Distribution>10000</Distribution>
</growthData>
<growthData>
<Year>1992</Year>
<asOfDate>December 31, 1992</asOfDate>
<Dividends>10655</Dividends>
<Distribution>10740</Distribution>
</growthData>
<growthData>
<Year>1993</Year>
<asOfDate>December 31, 1993</asOfDate>
<Dividends>12146</Dividends>
<Distribution>12297</Distribution>
</growthData>
</fundGrowthData>
Javascript:
var store = Ext.create('Ext.data.Store',{
autoLoad: true,
fields: ['Year','Dividends','Distribution'],
proxy: {
type: 'ajax',
url: 'pathtoXML',
reader: {
type: 'xml',
record: 'growthData'
}
}
});
Ext.onReady(function () {
Ext.create('Ext.chart.Chart', {
renderTo: Ext.get("js-chart"),
width: 800,
height: 600,
store: store,
axes: [
{
type: 'Numeric',
grid: true,
position: 'left',
fields: ['Dividends', 'Distribution'],
title: 'Sample Values',
grid: {
odd: {
opacity: 1,
fill: '#ddd',
stroke: '#bbb',
'stroke-width': 1
}
},
minimum: 0,
adjustMinimumByMajorUnit: 0
},
{
type: 'Category',
position: 'bottom',
fields: ['Year'],
title: 'Sample Metrics',
grid: true,
label: {
rotate: {
degrees: 315
}
}
}
],
series: [{
type: 'area',
highlight: true,
axis: 'left',
xField: 'Year',
yField: ['Dividends', 'Distribution'],
style: {
opacity: 0.93
}
}]
});
});