0

下面是我的 HTML 文件内容,我想将其显示为融合图表。我已经下载了所有 .js 文件。但仍然不显示图表。我必须添加任何其他文件吗?

<!DOCTYPE html><html><head><script type='text/javascript' src='FusionCharts.js'></script><script type='text/javascript' src='jquery.min.js'></script><script type='text/javascript' src='FusionCharts.HC.js'></script><script type='text/javascript' src='FusionCharts.HC.Charts.js'></script></head><body onload='addversion();'><div id='chart_container'>Chart will render here.</div><script type='text/javascript'>var chart_object = new FusionCharts('Bar2D.swf', 'ChartId2', '300.000000', '440.000000', '0', '1');FusionCharts.setCurrentRenderer('javascript');chart_object.setXMLUrl("204282.xml");chart_object.setTransparent(true);chart_object.render('chart_container');</script></body></html>

下面是我的 204282.xml 文件数据。

<chart  caption='Performance summary, ordered by Ownership'  subcaption='A Retail Deluxe Recent reviews' xAxisName='Ownership' yAxisName='Grade' numberSuffix='' canvasPadding='30' canvasRightMargin='30' placeValuesInside='0' paletteColors='f05528, f7341d, f7871d, f7e51d, dac5c3, ffffff' yAxisMinValue='1' yAxisMaxValue='7' numberScaleValue='1000000,1000' numberScaleUnit='M,B ' imageSave='1' imageSaveURL='libraries/fusioncharts/PHP/FCExporter.php' connectNullData='1'  showValues="1"   bgAlpha='1' showBorder='0' bgColor='FFFFFF' baseFontSize='11' showFCMenuItem='0' showExportDataMenuItem='1' exportShowMenuItem='1' exportDataMenuItemLabel='Copy data to CSV format' useRoundEdges='1' showAlternateVGridColor='1' alternateHGridAlpha='60' alternateVGridAlpha='10' showDivLineSecondaryValue='1' radarFillColor='FFFFFF' fullMode='1' numDivLines='5' canvasbgcolor='FFFFFF' canvasbgAlpha='100' saveAllPanelBgColor='E9E9E9' exportAtClient='0' exportAction='download' exportFileName='CheckerChart' decimals='1'  >  <set label="Self owned" toolText="57.39
Self owned
(10 branches)" value="57.39" link="report-property.php%3FClientID%3D106%26SetID%3D%26PropForFiltering%3D%26props%3D78%3B203%26WorkerID%3D0%26watchedReviews%3D%26reportDateArng%3D1%26hdrf_chosenCycleExtent%3D%26rangeStartd%3D0%26rangeStartm%3D0%26rangeStarty%3D0%26rangeEndd%3D0%26rangeEndm%3D0%26rangeEndy%3D0%26pastDateCyclesNumber%3D2%26selectedCycleExtent%3D%26displayType%3D3%26DyChartType%3DColumn2D%26DycX%3D-1%26DycY%3D-1%26callingReportPageName%3Dreport-property.php%26js_refresh%3D0%26js_submit%3D0%26isPopup%3D0%26go%3D1%26show%3D1%26appmode%3D1%26PropID%3D-1" />   <set label="Franchised" toolText="55.34
Franchised
(12 branches)" value="55.34" link="report-property.php%3FClientID%3D106%26SetID%3D%26PropForFiltering%3D%26props%3D78%3B204%26WorkerID%3D0%26watchedReviews%3D%26reportDateArng%3D1%26hdrf_chosenCycleExtent%3D%26rangeStartd%3D0%26rangeStartm%3D0%26rangeStarty%3D0%26rangeEndd%3D0%26rangeEndm%3D0%26rangeEndy%3D0%26pastDateCyclesNumber%3D2%26selectedCycleExtent%3D%26displayType%3D3%26DyChartType%3DColumn2D%26DycX%3D-1%26DycY%3D-1%26callingReportPageName%3Dreport-property.php%26js_refresh%3D0%26js_submit%3D0%26isPopup%3D0%26go%3D1%26show%3D1%26appmode%3D1%26PropID%3D-1" />   <set label="(Empty property value)" toolText="44.4
(Empty property value)
(8 branches)" value="44.4" link="report-property.php%3FClientID%3D106%26SetID%3D%26PropForFiltering%3D%26props%3D78%3B0%26WorkerID%3D0%26watchedReviews%3D%26reportDateArng%3D1%26hdrf_chosenCycleExtent%3D%26rangeStartd%3D0%26rangeStartm%3D0%26rangeStarty%3D0%26rangeEndd%3D0%26rangeEndm%3D0%26rangeEndy%3D0%26pastDateCyclesNumber%3D2%26selectedCycleExtent%3D%26displayType%3D3%26DyChartType%3DColumn2D%26DycX%3D-1%26DycY%3D-1%26callingReportPageName%3Dreport-property.php%26js_refresh%3D0%26js_submit%3D0%26isPopup%3D0%26go%3D1%26show%3D1%26appmode%3D1%26PropID%3D-1" />  <trendLines>
                <line  endValue='53.1' startValue='53.1' color='' displayvalue='Average
53.1' valueOnRight='1' />
                </trendLines> </chart>

提前致谢。

4

1 回答 1

1

这是“ /* 和/ /之间的 index.html 文件

<script type="text/javascript" src="http://www.fusioncharts.com/lib/jquery/jquery-1.6.2.min.js"></script>
<script language="JavaScript" src="http://www.fusioncharts.com/lib/js/FusionCharts.js"></script>
<script language="JavaScript" src="http://www.fusioncharts.com/lib/js/FusionCharts.HC.js"></script>
<script language="JavaScript" src="http://www.fusioncharts.com/lib/js/FusionCharts.HC.Charts.js"></script>
<script language="JavaScript" src="http://www.fusioncharts.com/lib/js/jquery.min.js"></script>

图表将在此处呈现。

<script type='text/javascript'>var chart_object = new FusionCharts('Bar2D.swf', 'ChartId2', '300.000000', '440.000000', '0', '1');FusionCharts.setCurrentRenderer('javascript');chart_object.setXMLUrl("204282.xml");chart_object.setTransparent(true);chart_object.render('chart_container');</script>

*/ 使用以下代码加载

NSString *filePath = [[NSBundle mainBundle]pathForResource:@"index" ofType:@"html"];
NSString *fileContents = [NSString stringWithContentsOfFile: filePath encoding:NSUTF8StringEncoding error:NULL];
NSURL *baseURL = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];

[webView  loadHTMLString: fileContents baseURL: baseURL];
于 2013-03-11T13:50:02.323 回答