Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

ECharts Responsive

ECharts Responsive

ECharts charts are displayed in a DOM node (container) whose height and width are specified by the user.

Sometimes we want to display chart content well on both PC and mobile devices, achieving a responsive design. To solve this problem, ECharts has improved component positioning settings and implemented a capability similar to CSS Media Query 's adaptive capability.


ECharts Component Positioning and Layout

Most 'components' and 'series' follow two positioning methods.

left/right/top/bottom/width/height positioning

Among these six quantities, each can be an 'absolute value', a 'percentage', or a 'position description'.

- you can set `left: 'center'` for horizontal centering. - you can set `top: 'middle'` for vertical centering.

The concept of these six quantities is similar to the six quantities in CSS:

Horizontally, among left, right, and width, only two need values, because any two can determine the component's position and size, e.g., left and right or right and width can both determine it. Vertically, top, bottom, and height behave similarly and are not repeated.

center / radius positioning

Horizontal and Vertical

ECharts's 'narrow-shaped' components (such as legend, visualMap, dataZoom, timeline, etc.) mostly offer a choice between 'horizontal layout' and 'vertical layout'. For example, on a slender mobile screen, 'vertical layout' may be suitable; on a wide PC screen, 'horizontal layout' may be suitable.

The horizontal/vertical layout setting is generally on the 'component' or 'series' orient or layout configuration item, set to 'horizontal' or 'vertical'.


Example

In the following example, you can try dragging the dot at the bottom right; the chart will change with the screen size, and the legend and series will automatically change their layout position and style.

In the example, we used jQuery to load external data; when using it, we need to import the jQuery library.

Example

$.when

(

    $.getScript

(

'https://www.runoob.com/static/js/timelineGDP.js'

)

,

    $.getScript

(

'https://www.runoob.com/static/js/draggable.js'

)

)

.done

(

function

(

)

{

    draggable.init

(

        $

(

'div[echarts_instance]'

)

[

0

]

,

        myChart,

       

{

            width:

700

,

            height:

400

,

            throttle:

70

       

}

   

)

;

    myChart.hideLoading

(

)

;

    option =

{

        baseOption:

{

            title :

{

                text:

'Nightingale Rose Chart'

,

                subtext:

'Purely Fictional'

,

                x:

'center'

           

}

,

            tooltip :

{

                trigger:

'item'

,

                formatter:

"{a}
{b} : {c} ({d}%)"

           

}

,

            legend:

{

                data:

[

'rose1'

,

'rose2'

,

'rose3'

,

'rose4'

,

'rose5'

,

'rose6'

,

'rose7'

,

'rose8'

]

           

}

,

            toolbox:

{

                show :

true

,

                feature :

{

                    mark :

{

show:

true

}

,

                    dataView :

{

show:

true

, readOnly:

false

}

,

                    magicType :

{

                        show:

true

,

                        type:

[

'pie'

,

'funnel'

]

                   

}

,

                    restore :

{

show:

true

}

,

                    saveAsImage :

{

show:

true

}

               

}

           

}

,

            calculable :

true

,

            series :

[

               

{

                    name:

'Radius Mode'

,

                    type:

'pie'

,

                    roseType :

'radius'

,

                    label:

{

                        normal:

{

                            show:

false

                       

}

,

                        emphasis:

{

                            show:

true

                       

}

                   

}

,

                    lableLine:

{

                        normal:

{

                            show:

false

                       

}

,

                        emphasis:

{

                            show:

true

                       

}

                   

}

,

                    data:

[

                       

{

value:

10

, name:

'rose1'

}

,

                       

{

value:

5

, name:

'rose2'

}

,

                       

{

value:

15

, name:

'rose3'

}

,

                       

{

value:

25

, name:

'rose4'

}

,

                       

{

value:

20

, name:

'rose5'

}

,

                       

{

value:

35

, name:

'rose6'

}

,

                       

{

value:

30

, name:

'rose7'

}

,

                       

{

value:

40

, name:

'rose8'

}

                   

]

               

}

,

               

{

                    name:

'Area Mode'

,

                    type:

'pie'

,

                    roseType :

'area'

,

                    data:

[

                       

{

value:

10

, name:

'rose1'

}

,

                       

{

value:

5

, name:

'rose2'

}

,

                       

{

value:

15

, name:

'rose3'

}

,

                       

{

value:

25

, name:

'rose4'

}

,

                       

{

value:

20

, name:

'rose5'

}

,

                       

{

value:

35

, name:

'rose6'

}

,

                       

{

value:

30

, name:

'rose7'

}

,

                       

{

value:

40

, name:

'rose8'

}

                   

]

               

}

           

]

       

}

,

        media:

[

           

{

                option:

{

                    legend:

{

                        right:

'center'

,

                        bottom:

0

,

                        orient:

'horizontal'

                   

}

,

                    series:

[

                       

{

                            radius:

[

20

,

'50%'

]

,

                            center:

[

'25%'

,

'50%'

]

                       

}

,

                       

{

                            radius:

[

30

,

'50%'

]

,

                            center:

[

'75%'

,

'50%'

]

                       

}

                   

]

               

}

           

}

,

           

{

                query:

{

                    minAspectRatio:

1

               

}

,

                option:

{

                    legend:

{

                        right:

'center'

,

                        bottom:

0

,

                        orient:

'horizontal'

                   

}

,

                    series:

[

                       

{

                            radius:

[

20

,

'50%'

]

,

                            center:

[

'25%'

,

'50%'

]

                       

}

,

                       

{

                            radius:

[

30

,

'50%'

]

,

                            center:

[

'75%'

,

'50%'

]

                       

}

                   

]

               

}

           

}

,

           

{

                query:

{

                    maxAspectRatio:

1

               

}

,

                option:

{

                    legend:

{

                        right:

'center'

,

                        bottom:

0

,

                        orient:

'horizontal'

                   

}

,

                    series:

[

                       

{

                            radius:

[

20

,

'50%'

]

,

                            center:

[

'50%'

,

'30%'

]

                       

}

,

                       

{

                            radius:

[

30

,

'50%'

]

,

                            center:

[

'50%'

,

'70%'

]

                       

}

                   

]

               

}

           

}

,

           

{

                query:

{

                    maxWidth:

500

               

}

,

                option:

{

                    legend:

{

                        right:

10

,

                        top:

'15%'

,

                        orient:

'vertical'

                   

}

,

                    series:

[

                       

{

                            radius:

[

20

,

'50%'

]

,

                            center:

[

'50%'

,

'30%'

]

                       

}

,

                       

{

                            radius:

[

30

,

'50%'

]

,

                            center:

[

'50%'

,

'75%'

]

                       

}

                   

]

               

}

           

}

       

]

   

}

;

    myChart.setOption

(

option

)

;

}

)

;

Try it »

To set Media Query in option, you must follow this format:

option = {

    baseOption: { // 这里是基本的『原子option』。

        title: {...},

        legend: {...},

        series: [{...}, {...}, ...],

        ...

    },

    media: [ // 这里定义了 media query 的逐条规则。

        {

            query: {...},   // 这里写规则。

            option: {       // 这里写此规则满足下的option。

                legend: {...},

                ...

            }

        },

        {

            query: {...},   // 第二个规则。

            option: {       // 第二个规则对应的option。

                legend: {...},

                ...

            }

        },

        {                   // 这条里没有写规则,表示『默认』,

            option: {       // 即所有规则都不满足时,采纳这个option。

                legend: {...},

                ...

            }

        }

    ]

};

In the example above, both baseOption and each media option are "atomic options", i.e., ordinary options containing component and series definitions. The entire option formed by combining "atomic options" is called a "composite option". baseOption is always used. In addition, when a query condition is satisfied, the corresponding option is merged in via chart.mergeOption().

query

Each query is similar to this:

{

    minWidth: 200,

    maxHeight: 300,

    minAspectRatio: 1.3

}

Three properties are currently supported: width, height, and aspectRatio. Each property can be prefixed with min or max. For example, minWidth: 200 means "greater than or equal to 200px width". Writing two properties together means "and", e.g., {minWidth: 200, maxHeight: 300} means "greater than or equal to 200px width, and less than or equal to 300px height".

option

Since the option in media is an "atomic option", theoretically any option configuration can be written. But generally we only write those related to layout positioning, e.g., taking a part of the query option from the example above:

media: [

    ...,

    {

        query: {

            maxAspectRatio: 1           // 当长宽比小于1时。

        },

        option: {

            legend: {                   // legend 放在底部中间。

                right: 'center',

                bottom: 0,

                orient: 'horizontal'    // legend 横向布局。

            },

            series: [                   // 两个饼图左右布局。

                {

                    radius: [20, '50%'],

                    center: ['50%', '30%']

                },

                {

                    radius: [30, '50%'],

                    center: ['50%', '70%']

                }

            ]

        }

    },

    {

        query: {

            maxWidth: 500               // 当容器宽度小于 500 时。

        },

        option: {

            legend: {

                right: 10,              // legend 放置在右侧中间。

                top: '15%',

                orient: 'vertical'      // 纵向布局。

            },

            series: [                   // 两个饼图上下布局。

                {

                    radius: [20, '50%'],

                    center: ['50%', '30%']

                },

                {

                    radius: [30, '50%'],

                    center: ['50%', '75%']

                }

            ]

        }

    },

    ...

]

Priority When Multiple Queries Are Satisfied

Note that multiple queries can be satisfied at the same time and will all be mergeOption'd; the one defined later is merged later (i.e., has higher priority).

Default query

If an item in media does not write a query, it means "default value", i.e., this option is adopted when none of the rules are satisfied.

Notes on Real-time Container Size Changes

In many cases, the container DOM node does not need to resize arbitrarily with dragging; instead, you only set a few typical sizes for different terminals.

However, if the container DOM node needs to resize arbitrarily with dragging, then you need to pay attention to this when using it: if a configuration item appears in one query option, it must also appear in other query options, otherwise it cannot return to the original state. (left/right/top/bottom/width/height are not subject to this restriction.)

The media in a "composite option" does not support merge

That is, when chart.setOption(rawOption) is called a second (or third, fourth, fifth ...) time, if rawOption is a composite option (i.e., contains a media list), the new rawOption.media list will not be merged with the old media list, but simply replaced. Of course, rawOption.baseOption will still be merged normally with the old option. In fact, there are few scenarios where a "composite option" needs to be setOption multiple times. Our recommended practice is: when using mediaQuery, use the "composite option" for the first setOption, and use only "atomic options" for subsequent setOption calls, i.e., use setOption only to change baseOption.

In the following, we used jQuery to load external data; when using it, we need to import the jQuery library. This example is combined with a timeline:

Example

$.

when

(

    $.

getScript

(

'https://www.runoob.com/static/js/timelineGDP.js'

)

,

    $.

getScript

(

'https://www.runoob.com/static/js/draggable.js'

)

)

.

done

(

function

(

)

{

    draggable.

init

(

        $

(

'div[echarts_instance]'

)

[

0

]

,

        myChart

,

       

{

            width

:

700

,

            height

:

630

,

            lockY

:

true

,

            throttle

:

70

       

}

   

)

;

    myChart.

hideLoading

(

)

;

   

var

categoryData

=

[

       

'Beijing'

,

'Tianjin'

,

'Hebei'

,

'Shanxi'

,

'Inner Mongolia'

,

'Liaoning'

,

'Jilin'

,

'Heilongjiang'

,

       

'Shanghai'

,

'Jiangsu'

,

'Zhejiang'

,

'Anhui'

,

'Fujian'

,

'Jiangxi'

,

'Shandong'

,

'Henan'

,

       

'Hubei'

,

'Hunan'

,

'Guangdong'

,

'Guangxi'

,

'Hainan'

,

'Chongqing'

,

'Sichuan'

,

'Guizhou'

,

       

'Yunnan'

,

'Tibet'

,

'Shaanxi'

,

'Gansu'

,

'Qinghai'

,

'Ningxia'

,

'Xinjiang'

   

]

;

    option

=

{

        baseOption

:

{

            timeline

:

{

                axisType

:

'category'

,

                autoPlay

:

true

,

                playInterval

:

1000

,

                data

:

[

                   

'2002-01-01'

,

'2003-01-01'

,

'2004-01-01'

,

                   

'2005-01-01'

,

'2006-01-01'

,

'2007-01-01'

,

                   

'2008-01-01'

,

'2009-01-01'

,

'2010-01-01'

,

                   

'2011-01-01'

               

]

,

                label

:

{

                    formatter

:

function

(

s

)

{

                       

return

(

new

Date

(

s

)

)

.

getFullYear

(

)

;

                   

}

               

}

           

}

,

            title

:

{

                subtext

:

'Media Query Example'

           

}

,

            tooltip

:

{

                trigger

:

'axis'

,

                axisPointer

:

{

                    type

:

'shadow'

               

}

           

}

,

            xAxis

:

{

                type

:

'value'

,

                name

:

'GDP (100 million yuan)'

,

                max

:

30000

,

                data

:

null

           

}

,

            yAxis

:

{

                type

:

'category'

,

                data

:

categoryData

,

                axisLabel

:

{

interval

:

0

}

,

                splitLine

:

{

show

:

false

}

           

}

,

            legend

:

{

                data

:

[

'Primary Industry'

,

'Secondary Industry'

,

'Tertiary Industry'

,

'GDP'

,

'Finance'

,

'Real Estate'

]

,

                selected

:

{

                   

'GDP'

:

false

,

'Finance'

:

false

,

'Real Estate'

:

false

               

}

           

}

,

            calculable

:

true

,

            series

:

[

               

{

name

:

'GDP'

,

type

:

'bar'

}

,

               

{

name

:

'Finance'

,

type

:

'bar'

}

,

               

{

name

:

'Real Estate'

,

type

:

'bar'

}

,

               

{

name

:

'Primary Industry'

,

type

:

'bar'

}

,

               

{

name

:

'Secondary Industry'

,

type

:

'bar'

}

,

               

{

name

:

'Tertiary Industry'

,

type

:

'bar'

}

,

               

{

name

:

'GDP Share'

,

type

:

'pie'

}

           

]

       

}

,

        media

:

[

           

{

                option

:

{

                    legend

:

{

                        orient

:

'horizontal'

,

                        left

:

'right'

,

                        itemGap

:

10

                   

}

,

                    grid

:

{

                        left

:

'10%'

,

                        top

:

80

,

                        right

:

90

,

                        bottom

:

100

                   

}

,

                    xAxis

:

{

                        nameLocation

:

'end'

,

                        nameGap

:

10

,

                        splitNumber

:

5

,

                        splitLine

:

{

                            show

:

true

                       

}

                   

}

,

                    timeline

:

{

                        orient

:

'horizontal'

,

                        inverse

:

false

,

                        left

:

'20%'

,

                        right

:

'20%'

,

                        bottom

:

10

,

                        height

:

40

                   

}

,

                    series

:

[

                       

{

name

:

'GDP Share'

,

center

:

[

'75%'

,

'30%'

]

,

radius

:

'28%'

}

                   

]

               

}

           

}

,

           

{

                query

:

{

maxWidth

:

670

,

minWidth

:

550

}

,

                option

:

{

                    legend

:

{

                        orient

:

'horizontal'

,

                        left

:

200

,

                        itemGap

:

5

                   

}

,

                    grid

:

{

                        left

:

'10%'

,

                        top

:

80

,

                        right

:

90

,

                        bottom

:

100

                   

}

,

                    xAxis

:

{

                        nameLocation

:

'end'

,

                        nameGap

:

10

,

                        splitNumber

:

5

,

                        splitLine

:

{

                            show

:

true

                       

}

                   

}

,

                    timeline

:

{

                        orient

:

'horizontal'

,

                        inverse

:

false

,

                        left

:

'20%'

,

                        right

:

'20%'

,

                        bottom

:

10

,

                        height

:

40

                   

}

,

                    series

:

[

                       

{

name

:

'GDP Share'

,

center

:

[

'75%'

,

'30%'

]

,

radius

:

'28%'

}

                   

]

               

}

           

}

,

           

{

                query

:

{

maxWidth

:

550

}

,

                option

:

{

                    legend

:

{

                        orient

:

'vertical'

,

                        left

:

'right'

,

                        itemGap

:

5

                   

}

,

                    grid

:

{

                        left

:

55

,

                        top

:

'32%'

,

                        right

:

100

,

                        bottom

:

50

                   

}

,

                    xAxis

:

{

                        nameLocation

:

'middle'

,

                        nameGap

:

25

,

                        splitNumber

:

3

                   

}

,

                    timeline

:

{

                        orient

:

'vertical'

,

                        inverse

:

true

,

                        right

:

10

,

                        top

:

150

,

                        bottom

:

10

,

                        width

:

55

                   

}

,

                    series

:

[

                       

{

name

:

'GDP Share'

,

center

:

[

'45%'

,

'20%'

]

,

radius

:

'28%'

}

                   

]

               

}

           

}

       

]

,

        options

:

[

           

{

                title

:

{

text

:

'2002 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2002'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2002'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2002'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2002'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2002'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2002'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2002sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2002sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2002sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2003 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2003'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2003'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2003'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2003'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2003'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2003'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2003sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2003sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2003sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2004 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2004'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2004'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2004'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2004'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2004'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2004'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2004sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2004sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2004sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2005 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2005'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2005'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2005'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2005'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2005'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2005'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2005sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2005sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2005sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2006 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2006'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2006'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2006'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2006'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2006'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2006'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2006sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2006sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2006sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2007 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2007'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2007'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2007'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2007'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2007'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2007'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2007sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2007sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2007sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2008 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2008'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2008'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2008'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2008'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2008'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2008'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2008sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2008sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2008sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2009 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2009'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2009'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2009'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2009'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2009'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2009'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2009sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2009sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2009sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2010 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2010'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2010'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2010'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2010'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2010'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2010'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2010sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2010sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2010sum'

]

}

                   

]

}

               

]

           

}

,

           

{

                title

:

{

text

:

'2011 National Macroeconomic Indicators'

}

,

                series

:

[

                   

{

data

:

dataMap.

dataGDP

[

'2011'

]

}

,

                   

{

data

:

dataMap.

dataFinancial

[

'2011'

]

}

,

                   

{

data

:

dataMap.

dataEstate

[

'2011'

]

}

,

                   

{

data

:

dataMap.

dataPI

[

'2011'

]

}

,

                   

{

data

:

dataMap.

dataSI

[

'2011'

]

}

,

                   

{

data

:

dataMap.

dataTI

[

'2011'

]

}

,

                   

{

data

:

[

                       

{

name

:

'Primary Industry'

,

value

:

dataMap.

dataPI

[

'2011sum'

]

}

,

                       

{

name

:

'Secondary Industry'

,

value

:

dataMap.

dataSI

[

'2011sum'

]

}

,

                       

{

name

:

'Tertiary Industry'

,

value

:

dataMap.

dataTI

[

'2011sum'

]

}

                   

]

}

               

]

           

}

       

]

   

}

;

    myChart.

setOption

(

option

)

;

}

)

;

Try it »