Get the App
SLTechnology News&Howtos  ›  Development  › 

How to cancel the default display of dots when pyecharts draws a map

Shulou Source: shulou.com Published: 2022-06-01 00:10:53 09月12日 Update

Today, I would like to share with you how to cancel the pyecharts map when the default display of dots mark the relevant knowledge points, detailed content, clear logic, I believe that most people still know too much about this knowledge, so share this article for your reference, I hope you have something to gain after reading this article, let's take a look at it.

1 problem

When using pyecharts to draw visual map information, the default image is marked with dots, such as the official website code.

The output is as follows:

2 problem solving

Method 1: showLegendSymbol=False

Ts import options as optsfrom pyecharts.chafrom pyecharrts import Mapdata = [['Liaoning', 325], ['Guangdong', 202], ['Zhejiang', 191], ['Jiangsu', 456], ['Shanghai', 76]] C = (Map () .add (", data," china ") .set _ series_opts (label_opts=opts.LabelOpts (is_show=False)) ShowLegendSymbol=False) # whether to display geographic information tags. Set _ global_opts (visualmap_opts=opts.VisualMapOpts (max_=500, is_piecewise=False), # controls whether segmentation or contiguous title_opts=opts.TitleOpts (title= "Geo- basic example") # title)) C.render_notebook ()

The output is as follows: (note that the parameters here are in the first layer of the set_series_opts setting, juxtaposed with the label_opts setting, different from one of the following solutions)

Method 2: itemstyle_opts=opts.ItemStyleOpts (color= "transparent")

From pyecharts import options as optsfrom pyecharts.charts import Mapdata = [['Liaoning', 325], ['Guangdong', 202], ['Zhejiang', 191], ['Jiangsu', 456], ['Shanghai', 76]] C = (Map () .add (", data," china ") .set _ series_opts (label_opts=opts.LabelOpts (is_show=False)) # whether to display the geographic information tag itemstyle_opts=opts.ItemStyleOpts (color= "transparent") .set _ global_opts (visualmap_opts=opts.VisualMapOpts (max_=500, is_piecewise=False), # Control Segmentation or continuous title_opts=opts.TitleOpts (title= "Geo- basic example") # graphic title)) C.render_notebook ()

The output result is as follows: (note that the identification is removed by making the color transparent. The parameters are under itemstyle_opts and belong to the settings in the second layer, which should be distinguished from the position of the first method.)

These are all the contents of the article "how to cancel the default display of dots when pyecharts draws a map". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

Tags: Mode knowledge article dot map logo information parameter tag output content geography geographic information is in example result or problem face Shanghai Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Docker Apple Xiaomi MySQL Shulou Information