diff --git a/remotespark/datawidgets/autovizwidget.py b/remotespark/datawidgets/autovizwidget.py
index f0b6405..f166c2e 100644
--- a/remotespark/datawidgets/autovizwidget.py
+++ b/remotespark/datawidgets/autovizwidget.py
@@ -3,20 +3,14 @@
 
 import pandas as pd
 from ipywidgets import FlexBox
-from IPython.display import display
 
+from remotespark.utils.ipythondisplay import IpythonDisplay
 from .encoding import Encoding
 from .encodingwidget import EncodingWidget
 from .ipywidgetfactory import IpyWidgetFactory
 from .plotlygraphs.graphrenderer import GraphRenderer
 
 
-class IpythonDisplay(object):
-    @staticmethod
-    def display_to_ipython(to_display):
-        display(to_display)
-
-
 class AutoVizWidget(FlexBox):
     def __init__(self, df, encoding, renderer=None, ipywidget_factory=None, encoding_widget=None, ipython_display=None,
                  nested_widget_mode=False, testing=False, **kwargs):
@@ -74,14 +68,14 @@ class AutoVizWidget(FlexBox):
         # self.controls.children
         self.to_display.clear_output()
 
-        self.renderer.render(self.df, self.encoding, self.to_display)
-
         self.encoding_widget.show_x(self.renderer.display_x(self.encoding.chart_type))
         self.encoding_widget.show_y(self.renderer.display_y(self.encoding.chart_type))
         self.encoding_widget.show_controls(self.renderer.display_controls(self.encoding.chart_type))
         self.encoding_widget.show_logarithmic_x_axis(self.renderer.display_logarithmic_x_axis(self.encoding.chart_type))
         self.encoding_widget.show_logarithmic_y_axis(self.renderer.display_logarithmic_y_axis(self.encoding.chart_type))
 
+        self.renderer.render(self.df, self.encoding, self.to_display)
+
     def _create_controls_widget(self):
         # Create types of viz hbox
         viz_types_widget = self._create_viz_types_buttons()
diff --git a/remotespark/datawidgets/plotlygraphs/datagraph.py b/remotespark/datawidgets/plotlygraphs/datagraph.py
index 130791b..a38a89a 100644
--- a/remotespark/datawidgets/plotlygraphs/datagraph.py
+++ b/remotespark/datawidgets/plotlygraphs/datagraph.py
@@ -1,17 +1,39 @@
 # Copyright (c) 2015  aggftw@gmail.com
 # Distributed under the terms of the Modified BSD License.
 
-from plotly.tools import FigureFactory as FigFac
-from plotly.offline import iplot
+import pandas as pd
 
+from remotespark.utils.ipythondisplay import IpythonDisplay
 
-class DataGraph(object):
-    @staticmethod
-    def render(df, encoding, output):
-        table = FigFac.create_table(df)
 
+class DataGraph(object):
+    """This does not use the table version of plotly because it freezes up the browser for >60 rows. Instead, we use
+    pandas df HTML representation."""
+    def __init__(self, display=None):
+        if display is None:
+            self.display = IpythonDisplay()
+        else:
+            self.display = display
+
+    def render(self, df, encoding, output):
         with output:
-            iplot(table, show_link=False)
+            max_rows = pd.get_option("display.max_rows")
+            max_cols = pd.get_option("display.max_columns")
+            show_dimensions = pd.get_option("display.show_dimensions")
+
+            # This will hide the index column for pandas df.
+            self.display.html_to_ipython("""
+<style>
+    table.dataframe.hideme thead th:first-child {
+        display: none;
+    }
+    table.dataframe.hideme tbody th {
+        display: none;
+    }
+</style>
+""")
+            self.display.html_to_ipython(df.to_html(max_rows=max_rows, max_cols=max_cols,
+                                                      show_dimensions=show_dimensions, notebook=True, classes="hideme"))
 
     @staticmethod
     def display_logarithmic_x_axis():
diff --git a/remotespark/datawidgets/plotlygraphs/piegraph.py b/remotespark/datawidgets/plotlygraphs/piegraph.py
index d8caf93..ecd881c 100644
--- a/remotespark/datawidgets/plotlygraphs/piegraph.py
+++ b/remotespark/datawidgets/plotlygraphs/piegraph.py
@@ -4,16 +4,29 @@
 from plotly.graph_objs import Pie, Figure, Data
 from plotly.offline import iplot
 
+import remotespark.utils.configuration as conf
+
 
 class PieGraph(object):
     @staticmethod
     def render(df, encoding, output):
-        series = df.groupby([encoding.x]).size()
-        data = [Pie(values=series.values.tolist(), labels=series.index.tolist())]
+        values, labels = PieGraph._get_x_values_labels(df, encoding)
+        max_slices_pie_graph = conf.max_slices_pie_graph()
 
         with output:
-            fig = Figure(data=Data(data))
-            iplot(fig, show_link=False)
+            # There's performance issues with a large amount of slices.
+            # 1500 rows crash the browser.
+            # 500 rows take ~15 s.
+            # 100 rows is almost automatic.
+            if len(values) > max_slices_pie_graph:
+                print("There's {} values in your pie graph, which would render the graph unresponsive.\n"
+                      "Please select another X with at most {} possible values."
+                      .format(len(values), max_slices_pie_graph))
+            else:
+                data = [Pie(values=values, labels=labels)]
+
+                fig = Figure(data=Data(data))
+                iplot(fig, show_link=False)
 
     @staticmethod
     def display_logarithmic_x_axis():
@@ -32,5 +45,6 @@ class PieGraph(object):
         return False
 
     @staticmethod
-    def _get_x_values(df, encoding):
-        return df[encoding.x].tolist()
+    def _get_x_values_labels(df, encoding):
+        series = df.groupby([encoding.x]).size()
+        return series.values.tolist(), series.index.tolist()
diff --git a/remotespark/default_config.json b/remotespark/default_config.json
index 9f9a410..5a9d09b 100644
--- a/remotespark/default_config.json
+++ b/remotespark/default_config.json
@@ -55,5 +55,6 @@
   },
 
   "use_auto_viz": true,
-  "max_results_sql": 800
+  "max_results_sql": 2500,
+  "max_slices_pie_graph": 100
 }
diff --git a/remotespark/utils/configuration.py b/remotespark/utils/configuration.py
index 0d1a311..e9abc9e 100644
--- a/remotespark/utils/configuration.py
+++ b/remotespark/utils/configuration.py
@@ -176,9 +176,14 @@ def ignore_ssl_errors():
 
 @_override
 def use_auto_viz():
-    return False
+    return True
 
 
 @_override
 def max_results_sql():
-    return 800
+    return 2500
+
+
+@_override
+def max_slices_pie_graph():
+    return 100
diff --git a/remotespark/utils/ipythondisplay.py b/remotespark/utils/ipythondisplay.py
new file mode 100644
index 0000000..0615aea
--- /dev/null
+++ b/remotespark/utils/ipythondisplay.py
@@ -0,0 +1,11 @@
+from IPython.core.display import display, HTML
+
+
+class IpythonDisplay(object):
+    @staticmethod
+    def display_to_ipython(to_display):
+        display(to_display)
+
+    @staticmethod
+    def html_to_ipython(to_display):
+        IpythonDisplay.display_to_ipython(HTML(to_display))

Incorrect visualizations on some sample data
Ran the following code:

    hvac = sc.textFile('wasb:///HdiSamples/HdiSamples/SensorSampleData/hvac/HVAC.csv')
    from pyspark.sql import Row
    Doc = Row("TargetTemp", "ActualTemp", "System", "SystemAge", "BuildingID")
    def parseDocument(line):
        values = [str(x) for x in line.split(',')]
        return Doc(values[2], values[3], values[4], values[5], values[6])
    documents = hvac.filter(lambda s: "Date" not in s).map(parseDocument)
    df = sqlContext.createDataFrame(documents)
    df.registerTempTable('data')

and then

    %select * from data limit 100

The visualizations, at least for the pie graphs, are wrong.  Screenshot:

![screen shot 2016-01-06 at 6 18 47 pm](https://cloud.githubusercontent.com/assets/13972471/12160578/3bdb966e-b4a2-11e5-97ce-ee297d0ca6cc.png)

Clearly there is no building where the desired target temperature is 1.

diff --git a/tests/datawidgetstests/test_plotlygraphs.py b/tests/datawidgetstests/test_plotlygraphs.py
index 6506b65..72b21b0 100644
--- a/tests/datawidgetstests/test_plotlygraphs.py
+++ b/tests/datawidgetstests/test_plotlygraphs.py
@@ -1,4 +1,5 @@
 import pandas as pd
+from mock import MagicMock
 
 from remotespark.datawidgets.plotlygraphs.graphbase import GraphBase
 from remotespark.datawidgets.plotlygraphs.piegraph import PieGraph
@@ -65,6 +66,39 @@ def test_pie_graph_display_methods():
     assert not PieGraph.display_logarithmic_y_axis()
 
 
+def test_pie_graph_get_values_labels():
+    records = [{u'buildingID': 0, u'date': u'6/1/13', u'temp_diff': 12},
+               {u'buildingID': 1, u'date': u'6/1/13', u'temp_diff': 0},
+               {u'buildingID': 2, u'date': u'6/1/14', u'temp_diff': 11},
+               {u'buildingID': 0, u'date': u'6/1/15', u'temp_diff': 5},
+               {u'buildingID': 1, u'date': u'6/1/16', u'temp_diff': 19},
+               {u'buildingID': 2, u'date': u'6/1/17', u'temp_diff': 32}]
+    df = pd.DataFrame(records)
+    encoding = Encoding(chart_type=Encoding.chart_type_line, x="date", y="temp_diff", y_aggregation=Encoding.y_agg_sum)
+
+    values, labels = PieGraph._get_x_values_labels(df, encoding)
+
+    assert values == [2, 1, 1, 1, 1]
+    assert labels == ["6/1/13", "6/1/14", "6/1/15", "6/1/16", "6/1/17"]
+
+
+def test_data_graph_render():
+    records = [{u'buildingID': 0, u'date': u'6/1/13', u'temp_diff': 12},
+               {u'buildingID': 1, u'date': u'6/1/13', u'temp_diff': 0},
+               {u'buildingID': 2, u'date': u'6/1/14', u'temp_diff': 11},
+               {u'buildingID': 0, u'date': u'6/1/15', u'temp_diff': 5},
+               {u'buildingID': 1, u'date': u'6/1/16', u'temp_diff': 19},
+               {u'buildingID': 2, u'date': u'6/1/17', u'temp_diff': 32}]
+    df = pd.DataFrame(records)
+    encoding = Encoding(chart_type=Encoding.chart_type_line, x="date", y="temp_diff", y_aggregation=Encoding.y_agg_sum)
+    display = MagicMock()
+
+    data = DataGraph(display)
+    data.render(df, encoding, MagicMock())
+
+    assert display.html_to_ipython.call_count == 2
+
+
 def test_data_graph_display_methods():
     assert not DataGraph.display_x()
     assert not DataGraph.display_y()

pip install -e .
parse_log_pytest
requirements.txt
nose pytest
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
anyio==4.9.0
argon2-cffi==23.1.0
argon2-cffi-bindings==21.2.0
arrow==1.3.0
async-lru==2.0.5
attrs==25.3.0
babel==2.17.0
beautifulsoup4==4.13.3
bleach==6.2.0
certifi==2025.1.31
cffi==1.17.1
charset-normalizer==3.4.1
comm==0.2.2
decorator==5.2.1
defusedxml==0.7.1
exceptiongroup==1.2.2
fastjsonschema==2.21.1
fqdn==1.5.1
h11==0.14.0
httpcore==1.0.7
httpx==0.28.1
idna==3.10
importlib_metadata==8.6.1
iniconfig==2.1.0
ipykernel==4.1.1
ipython==4.0.0
ipython-genutils==0.2.0
ipywidgets==7.8.5
isoduration==20.11.0
Jinja2==3.1.6
json5==0.10.0
jsonpointer==3.0.0
jsonschema==4.23.0
jsonschema-specifications==2024.10.1
jupyter-events==0.12.0
jupyter-lsp==2.2.5
jupyter_client==8.6.3
jupyter_core==5.7.2
jupyter_server==2.15.0
jupyter_server_terminals==0.5.3
jupyterlab==4.1.5
jupyterlab_pygments==0.3.0
jupyterlab_server==2.27.3
jupyterlab_widgets==1.1.11
MarkupSafe==3.0.2
mistune==3.1.3
mock==5.2.0
narwhals==1.32.0
nbclient==0.10.2
nbconvert==7.16.6
nbformat==5.10.4
nose==1.3.7
notebook==7.1.3
notebook_shim==0.2.4
numpy==2.0.2
overrides==7.7.0
packaging==24.2
pandas==2.2.3
pandocfilters==1.5.1
pexpect==4.9.0
pickleshare==0.7.5
platformdirs==4.3.7
plotly==6.0.1
pluggy==1.5.0
prometheus_client==0.21.1
ptyprocess==0.7.0
pycparser==2.22
Pygments==2.19.1
pytest==8.3.5
python-dateutil==2.9.0.post0
python-json-logger==3.3.0
pytz==2025.2
PyYAML==6.0.2
pyzmq==26.3.0
referencing==0.36.2
-e git+https://github.com/jupyter-incubator/sparkmagic.git@e29c15bf11fbada311796c36e1f5c9d7091b2667#egg=remotespark
requests==2.32.3
rfc3339-validator==0.1.4
rfc3986-validator==0.1.1
rpds-py==0.24.0
Send2Trash==1.8.3
simplegeneric==0.8.1
six==1.17.0
sniffio==1.3.1
soupsieve==2.6
terminado==0.18.1
tinycss2==1.4.0
tomli==2.2.1
tornado==6.4.2
traitlets==5.14.3
types-python-dateutil==2.9.0.20241206
typing_extensions==4.13.0
tzdata==2025.2
uri-template==1.3.0
urllib3==2.3.0
webcolors==24.11.1
webencodings==0.5.1
websocket-client==1.8.0
widgetsnbextension==3.6.10
zipp==3.21.0

name: sparkmagic
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - anyio==4.9.0
      - argon2-cffi==23.1.0
      - argon2-cffi-bindings==21.2.0
      - arrow==1.3.0
      - async-lru==2.0.5
      - attrs==25.3.0
      - babel==2.17.0
      - beautifulsoup4==4.13.3
      - bleach==6.2.0
      - certifi==2025.1.31
      - cffi==1.17.1
      - charset-normalizer==3.4.1
      - comm==0.2.2
      - decorator==5.2.1
      - defusedxml==0.7.1
      - exceptiongroup==1.2.2
      - fastjsonschema==2.21.1
      - fqdn==1.5.1
      - h11==0.14.0
      - httpcore==1.0.7
      - httpx==0.28.1
      - idna==3.10
      - importlib-metadata==8.6.1
      - iniconfig==2.1.0
      - ipykernel==4.1.1
      - ipython==4.0.0
      - ipython-genutils==0.2.0
      - ipywidgets==7.8.5
      - isoduration==20.11.0
      - jinja2==3.1.6
      - json5==0.10.0
      - jsonpointer==3.0.0
      - jsonschema==4.23.0
      - jsonschema-specifications==2024.10.1
      - jupyter-client==8.6.3
      - jupyter-core==5.7.2
      - jupyter-events==0.12.0
      - jupyter-lsp==2.2.5
      - jupyter-server==2.15.0
      - jupyter-server-terminals==0.5.3
      - jupyterlab==4.1.5
      - jupyterlab-pygments==0.3.0
      - jupyterlab-server==2.27.3
      - jupyterlab-widgets==1.1.11
      - markupsafe==3.0.2
      - mistune==3.1.3
      - mock==5.2.0
      - narwhals==1.32.0
      - nbclient==0.10.2
      - nbconvert==7.16.6
      - nbformat==5.10.4
      - nose==1.3.7
      - notebook==7.1.3
      - notebook-shim==0.2.4
      - numpy==2.0.2
      - overrides==7.7.0
      - packaging==24.2
      - pandas==2.2.3
      - pandocfilters==1.5.1
      - pexpect==4.9.0
      - pickleshare==0.7.5
      - platformdirs==4.3.7
      - plotly==6.0.1
      - pluggy==1.5.0
      - prometheus-client==0.21.1
      - ptyprocess==0.7.0
      - pycparser==2.22
      - pygments==2.19.1
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - python-json-logger==3.3.0
      - pytz==2025.2
      - pyyaml==6.0.2
      - pyzmq==26.3.0
      - referencing==0.36.2
      - requests==2.32.3
      - rfc3339-validator==0.1.4
      - rfc3986-validator==0.1.1
      - rpds-py==0.24.0
      - send2trash==1.8.3
      - simplegeneric==0.8.1
      - six==1.17.0
      - sniffio==1.3.1
      - soupsieve==2.6
      - terminado==0.18.1
      - tinycss2==1.4.0
      - tomli==2.2.1
      - tornado==6.4.2
      - traitlets==5.14.3
      - types-python-dateutil==2.9.0.20241206
      - typing-extensions==4.13.0
      - tzdata==2025.2
      - uri-template==1.3.0
      - urllib3==2.3.0
      - webcolors==24.11.1
      - webencodings==0.5.1
      - websocket-client==1.8.0
      - widgetsnbextension==3.6.10
      - zipp==3.21.0
prefix: /opt/conda/envs/sparkmagic

tests/datawidgetstests/test_plotlygraphs.py::test_pie_graph_get_values_labels tests/datawidgetstests/test_plotlygraphs.py::test_data_graph_render
tests/datawidgetstests/test_plotlygraphs.py::test_graphbase_get_x_y_values
tests/datawidgetstests/test_plotlygraphs.py::test_graph_base_display_methods tests/datawidgetstests/test_plotlygraphs.py::test_pie_graph_display_methods tests/datawidgetstests/test_plotlygraphs.py::test_data_graph_display_methods
remotespark/utils/configuration.py remotespark/datawidgets/autovizwidget.py remotespark/default_config.json remotespark/datawidgets/plotlygraphs/datagraph.py remotespark/datawidgets/plotlygraphs/piegraph.py remotespark/utils/ipythondisplay.py
remotespark/utils/configuration.py remotespark/datawidgets/autovizwidget.py remotespark/default_config.json remotespark/datawidgets/plotlygraphs/datagraph.py remotespark/datawidgets/plotlygraphs/piegraph.py remotespark/utils/ipythondisplay.py