class_docstr: Class Docstring
  
  - Styling (.style)
  - Plotting (.plot)
  - Callouts (.callout)
  - Axes (.axes)
  - Bokeh figure (.figure)
class_docstr_tok: ["Class","Docstring","-","Styling","(",".style",")","-","Plotting","(",".plot",")","-","Callouts","(",".callout",")","-","Axes","(",".axes",")","-","Bokeh","figure","(",".figure",")"]
docstr: Set the legend location.
  
  Args:
      location (str or tuple): Legend location. One of:
      - Outside of the chart: 'outside_top', 'outside_bottom',
            'outside_right'
      - Within the chart area: 'top_left', 'top_center',
            'top_right', 'center_left', 'center', 'center_right',
            'bottom_left', 'bottom_center', 'bottom_right'
      - Coordinates: Tuple(Float, Float)
      - None: Removes the legend.
      orientation (str): 'horizontal' or 'vertical'
  
  Returns:
      Current chart object
docstr_tok: ["Set","the","legend","location",".","Args",":","location","(","str","or","tuple",")",":","Legend","location",".","One","of",":","-","Outside","of","the","chart",":","'outside_top","'",",","'outside_bottom","'",",","'outside_right'","-","Within","the","chart","area",":","'top_left","'",",","'top_center","'",",","'top_right","'",",","'center_left","'",",","'center","'",",","'center_right","'",",","'bottom_left","'",",","'bottom_center","'",",","'bottom_right'","-","Coordinates",":","Tuple","(","Float",",","Float",")","-","None",":","Removes","the","legend",".","orientation","(","str",")",":","'horizontal","'","or","'vertical'","Returns",":","Current","chart","object"]
code: def set_legend_location(self, location, orientation="horizontal"):
      """Set the legend location.
  
      Args:
          location (str or tuple): Legend location. One of:
          - Outside of the chart: 'outside_top', 'outside_bottom',
                'outside_right'
          - Within the chart area: 'top_left', 'top_center',
                'top_right', 'center_left', 'center', 'center_right',
                'bottom_left', 'bottom_center', 'bottom_right'
          - Coordinates: Tuple(Float, Float)
          - None: Removes the legend.
          orientation (str): 'horizontal' or 'vertical'
  
      Returns:
          Current chart object
      """
  
      def add_outside_legend(legend_location, layout_location):
          self.figure.legend.location = legend_location
          if not self.figure.legend:
              warnings.warn(
                  """
                      Legend location will not apply.
                      Set the legend after plotting data.
                      """,
                  UserWarning,
              )
              return self
          new_legend = self.figure.legend[0]
          new_legend.orientation = orientation
          self.figure.add_layout(new_legend, layout_location)
  
      if location == "outside_top":
          add_outside_legend("top_left", "above")
          # Re-render the subtitle so that it appears over the legend.
          subtitle_index = self.figure.renderers.index(
              self._subtitle_glyph
          )
          self.figure.renderers.pop(subtitle_index)
          self._subtitle_glyph = self._add_subtitle_to_figure(
              self._subtitle_glyph.text
          )
      elif location == "outside_bottom":
          add_outside_legend("bottom_center", "below")
      elif location == "outside_right":
          add_outside_legend("top_left", "right")
      elif location is None:
          self.figure.legend.visible = False
      else:
          self.figure.legend.location = location
          self.figure.legend.orientation = orientation
  
      vertical = self.axes._vertical
      # Reverse the legend order
      if self._reverse_vertical_legend:
          if orientation == "vertical" and vertical:
              self.figure.legend[0].items = list(
                  reversed(self.figure.legend[0].items)
              )
      return self
  
imports: from collections import OrderedDict
  from functools import wraps
  import io
  from io import BytesIO
  import tempfile
  import warnings
  import bokeh
  from bokeh.io.export import _SVG_SCRIPT, wait_until_render_complete
  import bokeh.plotting
  from bokeh.embed import file_html
  from bokeh.resources import INLINE
  from IPython.display import display
  from PIL import Image
  from PIL.Image import Resampling
  from selenium import webdriver
  from selenium.webdriver.chrome.options import Options
  from chartify._core.style import Style
  from chartify._core.axes import BaseAxes, SecondYNumericalAxis, SecondAxis
  from chartify._core.plot import BasePlot
  from chartify._core.callout import Callout
  from chartify._core.options import options
label_desc: Use image node_id 14 for calling the Chart obj's underlying member method code with example usage: obj.set_legend_location(location, orientation) and returns: self, self