code: def test_labels_with_links(Chart):
      """Test values with links"""
      chart = Chart()
      # link on chart and label
      chart.add(
          {
              "title": "Red",
              "xlink": {"href": "http://en.wikipedia.org/wiki/Red"},
          },
          [
              {
                  "value": 2,
                  "label": "This is red",
                  "xlink": {"href": "http://en.wikipedia.org/wiki/Red"},
              }
          ],
      )
  
      # link on chart only
      chart.add(
          "Green",
          [
              {
                  "value": 4,
                  "label": "This is green",
                  "xlink": {
                      "href": "http://en.wikipedia.org/wiki/Green",
                      "target": "_top",
                  },
              }
          ],
      )
  
      # link on label only opens in new tab
      chart.add(
          {
              "title": "Yellow",
              "xlink": {
                  "href": "http://en.wikipedia.org/wiki/Yellow",
                  "target": "_blank",
              },
          },
          7,
      )
  
      # link on chart only
      chart.add(
          "Blue",
          [
              {
                  "value": 5,
                  "xlink": {
                      "href": "http://en.wikipedia.org/wiki/Blue",
                      "target": "_blank",
                  },
              }
          ],
      )
  
      # link on label and chart with diffrent behaviours
      chart.add(
          {
              "title": "Violet",
              "xlink": "http://en.wikipedia.org/wiki/Violet_(color)",
          },
          [
              {
                  "value": 3,
                  "label": "This is violet",
                  "xlink": {
                      "href": "http://en.wikipedia.org/wiki/Violet_(color)",
                      "target": "_self",
                  },
              }
          ],
      )
  
      q = chart.render_pyquery()
      links = q("a")
  
      assert (
          len(links) == 7
          or isinstance(chart, BaseMap)
          and len(links) == 3
      )
  
imports: import io
  import os
  import uuid
  import pytest
  import pygal
  from pygal.graph.map import BaseMap
  from pygal.test import make_data
  from pygal.util import cut
label_desc: Use image node_id 22 for calling a global function with example usage: test_labels_with_links(Chart) without return types