'Construct a new ``Chart`` display.'

def __init__(self, chart, root=None, **kw):

    draw_tree = kw.get('draw_tree', 0)
    draw_sentence = kw.get('draw_sentence', 1)
    self._fontsize = kw.get('fontsize', (-12))
    self._chart = chart
    self._callbacks = {}
    self._edgelevels = []
    self._edgetags = {}
    self._marks = {}
    self._treetoks = []
    self._treetoks_edge = None
    self._treetoks_index = 0
    self._tree_tags = []
    self._compact = 0
    if (root is None):
        top = Tk()
        top.title('Chart    View')
        def destroy1(e, top=top):
            top.destroy()
        def destroy2(top=top):
            top.destroy()
        top.bind('q', destroy1)
        b = Button(top, text='Done', command=destroy2)
        b.pack(side='bottom')
        self._root = top
    else:
        self._root = root
    self._init_fonts(root)
    (self._chart_sb, self._chart_canvas) = self._sb_canvas(self._root)
    self._chart_canvas['height'] = 300
    self._chart_canvas['closeenough'] = 15
    if draw_sentence:
        cframe = Frame(self._root, relief='sunk', border=2)
        cframe.pack(fill='both', side='bottom')
        self._sentence_canvas = Canvas(cframe, height=50)
        self._sentence_canvas['background'] = '#e0e0e0'
        self._sentence_canvas.pack(fill='both')
    else:
        self._sentence_canvas = None
    if draw_tree:
        (sb, canvas) = self._sb_canvas(self._root, 'n', 'x')
        (self._tree_sb, self._tree_canvas) = (sb, canvas)
        self._tree_canvas['height'] = 200
    else:
        self._tree_canvas = None
    self._analyze()
    self.draw()
    self._resize()
    self._grow()
    self._chart_canvas.bind('<Configure>', self._configure)
