diff --git a/flot_views/views/flot_fields_views_plugin_style.inc b/flot_views/views/flot_fields_views_plugin_style.inc
index 3915adb..ff01772 100644
--- a/flot_views/views/flot_fields_views_plugin_style.inc
+++ b/flot_views/views/flot_fields_views_plugin_style.inc
@@ -645,6 +645,9 @@ class flot_fields_views_plugin_style extends views_plugin_style {
     }
 
     foreach (array('xaxis', 'yaxis') as $axis) {
+      if(!isset($style->{$axis})){
+          $style->{$axis} = new stdClass(); 
+      }
       $style->{$axis}->show = ($options['show' . $axis]) ? TRUE : FALSE;
       if ($style->{$axis}->show) {
         switch ($options[$axis]['granularity']) {
@@ -669,6 +672,10 @@ class flot_fields_views_plugin_style extends views_plugin_style {
     if ($fieldx->options['flot']['x']['mode'] == 'time') {
       $style->xaxis->mode = 'time';
     }
+    if(!isset($style->legend))
+    {
+        $style->legend = new stdClass();
+    }
     $style->legend->show = (!isset($options['showlegend']) || $options['showlegend'] == 'yes') ? TRUE : FALSE;
     if ($style->legend->show) {
       foreach ($options['legend'] as $key => $val) {
