Sign in to follow this  
ron.savage

V 3.10.1 StackedBar3D has defective dataset structure

Recommended Posts

This used to work in V 3.8.0. It fails in V 3.9.0 and 3.10.0 and 3.10.1.

 

In the attached file I've chopped off the <script> and </scripts> tags to keep your uploader happy :-).

 

This is the data structure, dumped by PHP:

281 2016-03-17 04:44:24 Debug: dataset_17:
282 Array
283 (
284     [0] => Array
285         (
286             => #1e90ff
287             [data] => Array
288                 (
289                     [0] => Array
290                         (
291                             [toolText] => Sales Revenue decreased %1 or $767,785
292                             [value] => -767785
293                         )
294
295                 )
296
297             [renderAs] => Column
298             [seriesName] => Sales Revenue
299         )
300
301     [1] => Array
302         (
303             => #1e90ff
304             [data] => Array
305                 (
306                     [1] => Array
307                         (
308                             [toolText] => Gross Profit decreased %3 or $2,796,787
309                             [value] => -2796787
310                         )
311
312                 )
313
314             [renderAs] => Column
315             [seriesName] => Gross Profit
316         )
317
318 )
 

You can see the 1st bit of data (Sales Revenue decreased %1 or $767,785) is in [0][data][0] and the 2nd (Gross Profit decreased %3 or $2,796,787) is in [1][data][1]. This is /deliberate/.

 

And this is rendered by recent versions of FusionCharts below. Observe that the 1st render of "data" is [{...}] but the 2nd is {"1": {...} }.

<script>
    render_chart
    (
        'chart_div_17',
        'StackedBar3D',
        {
            "adjustDiv":"0","animationDuration":"0","baseFont":"didact gothic","baseFontColor":"#7f7f7f",

            ...
        },
        [
            {
                "category":
                [
                    {"label":"Sales Revenue"},
                    {"label":"Gross Profit"}
                ]
            }
        ],
        [
            {
                "color":"#1e90ff",
                "data":
                [
                    {
                        "toolText":"Sales Revenue decreased  or $767,785",
                        "value":"-767785"
                    }
                ],
                "renderAs":"Column",
                "seriesName":"Sales Revenue"
            },
            {
                "color":"#1e90ff",
                "data":
                {
                    "1":
                    {
                        "toolText":"Gross Profit decreased  or $2,796,787",
                        "value":"-2796787"
                    }
                },
                "renderAs":"Column",
                "seriesName":"Gross Profit"
            }
        ],
        1000,
        600
    );
</script>

rendered.script.txt

Share this post


Link to post
Share on other sites

Hi

 

Thanx for the reply.

 

We have never used the PHP wrapper. Are you saying it's mandatory?

 

And re the link (which I have not seen before), I don't believe we need it since the code was running for about 15 months before the upgrades I attempted.

Share this post


Link to post
Share on other sites

Hi Ron,

 

The dataset structure for Stacked Bar 3D chart has not changed from 3.8 to 3.10.1 .

 

Ref. 3.8 http://docs.fusioncharts.com/archive/3.8.0/chart-attributes.html?chart=stackedbar3d

 

Latest: http://www.fusioncharts.com/dev/chart-attributes.html?chart=stackedbar3d

 

Code structure: 

 

{
            "chart": {
               
            },
                "categories": [{
                "category": [{
                    "label": "Q1"
                }....]
            }],
                "dataset": [{
                "seriesname": "Food Products",
                    "data": [{
                    "value": "121000"
                },
...
]
            }, {
                "seriesname": "Non-Food Products",
                    "data": [{
                    "value": "131400"
                },
....
]
            }]
        }
 
Can please cross check it once.
 
Thanks.

Share this post


Link to post
Share on other sites

I know that. I'm saying your code which parses the data structure has changed, and introduced a bug, so data which you used to parse successfully no longer parses.

So, did your code change?

And if so, was the change intentional?

And can your old 3.8 code parse my data?

And can your most recent code parse my data?

TIA.

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
Sign in to follow this