jcesarotero

Ipad Simulator Works. Device Does Not Work.

Recommended Posts

Hello :

 

I've made a sample project on XCode 4 that ...

- Loads HTML webpage from local storage (Bundle Resources) and it's loaded on a UIWebView object in MainWindow

- HTML code draws FusionCharts Graph using Data.xml local file

- Project includes FusionCharts.js highcharts.js and jquery.min.js files as JavaScript (not compiled) files in Bundle Resources, included on package when compiled

 

Testing this project on ...

- iPad Simulator : Works OK !

- iPad Device : Fails :-( (it does not render graph)

- iPhone Simulator : Fails :-( (it does not render graph)

- iPhone Device : Fails :-( (it does not render graph)

 

 

HTML Content File is ...

====================

<html>

 

<head>

 

<title>My First chart using FusionCharts - Using JavaScript</title>

 

<script type="text/javascript" src="FusionCharts.js"></script>

 

</head>

 

<body>

 

<div id="GraphArea" align="center">Grafico</div>

 

<script type="text/javascript">

 

 

 

 

 

var myChart = new FusionCharts("Column2D.swf",

 

"MyGraph", "400", "300", "1", "1" );

 

myChart.setXMLUrl("Data.xml");

 

myChart.render("GraphArea");

 

myChart.bgColor

 

 

 

</script>

 

<h5 align="center">-- Fin --</h5>

 

</body>

 

</html>

 

 

 

====================

 

NOTE : Debugging and registerWithJS are ON ("1", "1"), but no debugging info is shown.

 

 

 

XML Data File says ....

====================

<?xml version="1.0"?>

 

<chart caption="Resumen de Ventas" subCaption="Ejercicio 2011" numberSuffix="€" sNumberSuffix="€" formatNumberScale="0" syncAxisLimits="1" rotateValues="1" showSum="0" decimalSeparator="," thousandSeparator="." bgColor="ccddee,aabbcc">

 

<!-- Data for single series chart -->

 

<set label="1 Trimestre" value="232400.25"/>

 

<set label="2 Trimestre" value="339800.75"/>

 

<set label="3 Trimestre" value="411900.48"/>

 

<set label="4 Trimestre" value="398400.35"/>

 

<!-- Data for multi-series stacked and combination chart -->

 

<categories>

 

<category label="1T"/>

 

<category label="2T"/>

 

<category label="3T"/>

 

<category label="4T"/>

 

</categories>

 

<dataset seriesName="Artículos">

 

<set value="232400"/>

 

<set value="232400"/>

 

<set value="339800"/>

 

<set value="411900"/>

 

<set value="398400"/>

 

<!-- Data for multi-series stacked chart - nested dataset-->

 

<dataset seriesName="123 - Cervezas">

 

<set value="232400"/>

 

<set value="232400"/>

 

<set value="339800"/>

 

<set value="411900"/>

 

<set value="398400"/>

 

</dataset>

 

<dataset seriesName="556 - Aguas">

 

<set value="232400"/>

 

<set value="232400"/>

 

<set value="339800"/>

 

<set value="411900"/>

 

<set value="398400"/>

 

</dataset>

 

</dataset>

 

<dataset seriesName="Servicios" renderAs="line" parentYAxis="S" showValues="1" valuePosition="BELOW">

 

<set value="147400"/>

 

<set value="189100"/>

 

<set value="219800"/>

 

<set value="289100"/>

 

<set value="209800"/>

 

<!-- Data for multi-series stacked chart - nested dataset-->

 

<dataset seriesName="Todos los Servicios" renderAs="line" parentYAxis="S">

 

<set value="214400"/>

 

<set value="214100"/>

 

<set value="284800"/>

 

<set value="323100"/>

 

<set value="324800"/>

 

</dataset>

 

</dataset>

 

<!-- Data for multi-series stacked chart line chart - line dataset -->

 

<lineset seriesName="Objetivo de Rentabilidad" valuePosition="BELOW">

 

<set value="104400"/>

 

<set value="104100"/>

 

<set value="144800"/>

 

<set value="213100"/>

 

<set value="214800"/>

 

</lineset>

 

</chart>

 

 

====================

 

It renders graph OK always on iPad Simulator (whatever kind of chart you try [Line, Column2D, Bar2D, MSBar2D, ...]) but fails on iPhone Simulator and both kind of devices (iPad and iPhone).

 

By the way, 2 additional errors when program is tested on iPad Simulator ...

a) Background Color shows always BLACK COLOR (whatever color indicated as bgColor)

:) Numbers do not show DECIMAL SEPARATOR and THOUSAND SEPARATOR as indicated by decimalSeparator and thousandSeparator parameters (numbers shown in graph apply POINT as DECIMAL SEPARATOR instead COMMA, and COMMA as THOUSAND SEPARATOR instead POINT)

Any suggestions or ideas about how to debug program to get it work on iPhone/iPad devices and not only on iPad Simulator ?.

Are background and decimal/thousand separators FusionCharts bugs, or may be bugs from simulator behaviour ?.

 

Thanks in advance for any clues !

 

 

Share this post


Link to post
Share on other sites

Hello :

 

Eureka !. Now FusionCharts works on both : emulator and device (Iphone and also iPad).

 

What helped to get it work ?. This post helped me a lot ...

http://stackoverflow.com/questions/2017937/how-to-add-js-file-to-my-xcode-project

 

Xcode compiles, by default,. any *.js file included in Xcode project.

Instructions from previous link show how to tell Xcode not to compile *.js files. Instead they must be only copied (without any changes ;-)

 

So, at this moment 2 problems remain pending ...

a) FusionCharts shows BLACK background color ALWAYS ¡¡¡ only on Simulator !!! (devices, iPad ios 4.3.3 and iPhone show WHITE background fine ;-)

:D Decimal and Thousand separators don't work. Although "." is indicated for Thousand Separator and "," is passed as Decimal Separator numbers are show as 123,456.78 instead 123.456,78

 

Any ideas ?.

 

Thanks in advance.

Share this post


Link to post
Share on other sites

Hi,

 

I just checked with the iPhone simulator with the following data containing decimalSeparator=',' thousandSeparator='.'

 

<chart caption="FusionCharts in iPhone" subCaption="bet you like it!" showLabels='0' showLegend="1" bgColor='616E9D' borderColor='616E9D' borderThickness='5' baseFontColor='FFFFFF' legendbgColor='414E7D'  decimalSeparator=',' thousandSeparator='.' formatNumberScale='0'>
<set label="FusionCharts v3.2" value="232400.05"/>
<set label="PowerCharts" value="339800.04"/>
<set label="FusionMaps" value="411900.3"/>
<set label="FusionWidgets" value="398400.51"/>
</chart>

 

The separators are appearing as expected.

 

Please check the attached image.

 

post-179-037775600 1307539126_thumb.jpg

 

You might try using the latest js files (attached) which we are going to release soon with 3.2.2.

FusionCharts.js_eval_beta322.zip

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now