'mapline': {
                'showInLegend': False,
                'enableMouseTracking': False
            }
        },
    } 

H.set_dict_options(options)
data_url = 'http://www.highcharts.com/samples/data/jsonp.php?filename=us-counties-unemployment.json&callback=?'
H.add_data_from_jsonp(data_url, 'json_data', 'map', 'Unemployment rate', joinBy = ['hc-key', 'code'], 
     tooltip = {
                    'valueSuffix': '%'
                },
                borderWidth = 0.5,
                states = {
                    'hover': {
                        'color': '#bada55'
                    }
                }
                )
H.add_data_set(RawJavaScriptText('[lines[0]]'), 'mapline', 'State borders', color = 'white')
H.add_data_set(RawJavaScriptText('[lines[1]]'), 'mapline', 'Separator', color = 'gray')
H.set_map_source('http://code.highcharts.com/mapdata/countries/us/us-all-all.js', jsonp_map = False)
H.add_JSscript("var lines = Highcharts.geojson(Highcharts.maps['countries/us/us-all-all'], 'mapline');", 'head')
H.add_JSscript("Highcharts.each(geojson, function (mapPoint) {\
            mapPoint.name = mapPoint.name + ', ' + mapPoint.properties['hc-key'].substr(3, 2);\
        });", 'head')

H.htmlcontent

Пример #2
0
    'json_data',
    'map',
    'Population density',
    joinBy=['postal-code', 'code'],  # add dataset from data_src using jsonp
    dataLabels={
        'enabled': True,
        'color': 'white',
        'format': '{point.code}'
    },
    tooltip={'pointFormat': '{point.code}: {point.value}/km²'})

H.set_map_source('http://code.highcharts.com/mapdata/countries/us/us-all.js',
                 jsonp_map=False)
"""
python-highcharts provides add_JSscript method:
add_JSscript(js_script, js_loc):
js_script is the javascript string 
js_loc is location of this javascript string, can be either head (at beginning of the script) or
end (in the end of the script)

The JS string here is a function to convert (state) codes in dateset to Upper case (from lower)
However, it is not recommended to do it this way. 
The better practice is to load data into python environment and handle in python. 
It can be done by writting a python script or using the functions in highmap_helper module
"""
H.add_JSscript(
    "$.each(json_data, function () {\
            this.code = this.code.toUpperCase();\
        });", 'head')

H.htmlcontent
data_url = 'http://www.highcharts.com/samples/data/jsonp.php?filename=us-population-density.json&callback=?' # set data_src
H.add_data_from_jsonp(data_url, 'json_data', 'map', 'Population density', joinBy = ['postal-code', 'code'], # add dataset from data_src using jsonp
     dataLabels = {
                    'enabled': True,
                    'color': 'white',
                    'format': '{point.code}'
                },
                tooltip = {
                    'pointFormat': '{point.code}: {point.value}/km²'
                }
                )

H.set_map_source('http://code.highcharts.com/mapdata/countries/us/us-all.js', jsonp_map = False)

"""
python-highcharts provides add_JSscript method:
add_JSscript(js_script, js_loc):
js_script is the javascript string 
js_loc is location of this javascript string, can be either head (at beginning of the script) or
end (in the end of the script)

The JS string here is a function to convert (state) codes in dateset to Upper case (from lower)
However, it is not recommended to do it this way. 
The better practice is to load data into python environment and handle in python. 
It can be done by writting a python script or using the functions in highmap_helper module
"""
H.add_JSscript("$.each(json_data, function () {\
            this.code = this.code.toUpperCase();\
        });", 'head')

H.htmlcontent