diff --git a/UPDATES.md b/UPDATES.md index a420177..032fc0f 100644 --- a/UPDATES.md +++ b/UPDATES.md @@ -6,9 +6,14 @@ Some of the libraries featured in the book have been updated recently, which is Chapter 15 --- -Pygal has been updated to version 2. You can install a version of Pygal that runs the code exactly as it's written in the book, or you can install the latest version of Pygal and modify what's in the book slightly. See [installing Pygal](chapter_15/README.md#installing-pygal), and see the [updates to Chapter 15](chapter_15/README.md#updates). +Pygal has been updated to version 2. You can install a version of Pygal that runs the code exactly as it's written in the book, or you can install the latest version of Pygal and modify what's in the book slightly. See [installing Pygal](chapter_15/README.md#installing-pygal), and see the [updates to Chapter 15](chapter_15/README.md#updates) to make tooltips appear on charts. Chapter 16 --- -Pygal's world map and internationalization features have been moved to a separate module. See the section on [installing Pygal](chapter_15/README.md#installing-pygal), and see the specific updates for [Chapter 16](chapter_16/README.md). \ No newline at end of file +Pygal's world map and internationalization features have been moved to a separate module. See the section on [installing Pygal](chapter_15/README.md#installing-pygal), and see the specific [updates for Chapter 16](chapter_16/README.md#updates). + +Chapter 17 +--- + +The [updates to Chapter 17](chapter_17/README.md#updates) allow tooltips to show on charts generated with Pygal. \ No newline at end of file diff --git a/chapter_16/README.md b/chapter_16/README.md index bfb0e84..d9057d7 100644 --- a/chapter_16/README.md +++ b/chapter_16/README.md @@ -7,7 +7,7 @@ You can easily [install a version of Pygal](chapter_15/README.md#installing-pyga The first part of this update will tell you what to look for as you work through the section **Mapping Global Data Sets: JSON Format**, which begins on page 362. The second part will give you a page by page update. You can see the updated code files [here](pygal2_update/). -Overall updates +Updates --- ### The `pygal_maps_world` package @@ -36,6 +36,15 @@ In the line that creates the world map, change `Worldmap` to `World`: wm = World() +### Rendering tooltips correctly + +As you probably saw in [Chapter 15](chapter_15/README.md#updates), you need to add a line each time you make a chart in order to render tooltips correctly: + +
+wm = World()
+wm.force_uri_protocol = 'http'
+
+ Page by page updates --- @@ -49,16 +58,17 @@ Use **`from pygal.maps.world import COUNTRIES`** instead of `from pygal.i18n imp Use **`from pygal.maps.world import World`** instead of `import pygal`. -Use **`wm = World()`** instead of `wm = pygal.Worldmap()`. +Use **`wm = World()`** instead of `wm = pygal.Worldmap()`. Then add the line **`wm.force_uri_protocol = 'http'`**. ### p. 368, *na_populations.py* Use **`from pygal.maps.world import World`** instead of `import pygal`. -Use **`wm = World()`** instead of `wm = pygal.Worldmap()`. +Use **`wm = World()`** instead of `wm = pygal.Worldmap()`. Then add the line **`wm.force_uri_protocol = 'http'`**. ### p. 369-370, *world_populations.py* Use **`from pygal.maps.world import World`** instead of `import pygal`. -Use **`wm = World()`** instead of `wm = pygal.Worldmap()`. \ No newline at end of file +Use **`wm = World()`** instead of `wm = pygal.Worldmap()`. Then add the line **`wm.force_uri_protocol = 'http'`**.s + diff --git a/chapter_17/README.md b/chapter_17/README.md index aaccd79..461a11c 100644 --- a/chapter_17/README.md +++ b/chapter_17/README.md @@ -1,3 +1,29 @@ Chapter 17 === +Updates +--- + +As you probably saw in [Chapter 15](chapter_15/README.md#updates) and [Chapter 16](chapter_16/README.md#updates), you'll need to add a line each time you make a chart in order to render tooltips correctly: + +
+chart = pygal.Bar()
+chart.force_uri_protocol = 'http'
+
+ +Page by page updates +--- + +### p. 384-385, python_repos.py + +
+chart = pygal.Bar(style=my_style, x_label_rotation=45, show_legend=False)
+chart.force_uri_protocol = 'http'
+
+ +### p. 387-388, bar_descriptions.py + +
+chart = pygal.Bar(style=my_style, x_label_rotation=45, show_legend=False)
+chart.force_uri_protocol = 'http'
+
\ No newline at end of file