Repository: getredash/redash

Issue:
Row count limitation when creating chart visualization
Graphing query with series data works fine when there are 1150 rows returned (total) but not when I go back further in time and get 1543 rows.  The chart shows just one of the two data points used as series.  The error in the console shows: "Highcharts error #12: www.highcharts.com/errors/12", and the link refers to the turboThreshold.  I did not see any references to this when searching through the code. 

Row count limitation when creating chart visualization
Graphing query with series data works fine when there are 1150 rows returned (total) but not when I go back further in time and get 1543 rows.  The chart shows just one of the two data points used as series.  The error in the console shows: "Highcharts error #12: www.highcharts.com/errors/12", and the link refers to the turboThreshold.  I did not see any references to this when searching through the code. 



Discussion:
It's a HighCharts limitation. They have two suggested solutions (mentioned on the linked error page), but I never had the chance to explore this in detail.

You can try to disable the `turboThreshold` value to disable the limitation or just change it to higher value (2000? 5000?).

There is an "advanced" undocumented option of editing the JSON parameters passed to HighCharts. If you're interested, I can explain how to enable it.

Thanks!  Would you be able to give some guidance where I would change the turboThreshold value?  Or is the only way to do this through the undocumented option you mention above?

Currently it's only possible through the undocumented option. It will require shell access to the re:dash server, to add the required permission to your user.

As an alternative, I can add tomorrow the `turboThreshold` as a configuration parameter to re:dash. It will require you to upgrade once I do that. http://docs.redash.io/en/latest/upgrade.html

It's a HighCharts limitation. They have two suggested solutions (mentioned on the linked error page), but I never had the chance to explore this in detail.

You can try to disable the `turboThreshold` value to disable the limitation or just change it to higher value (2000? 5000?).

There is an "advanced" undocumented option of editing the JSON parameters passed to HighCharts. If you're interested, I can explain how to enable it.

Thanks!  Would you be able to give some guidance where I would change the turboThreshold value?  Or is the only way to do this through the undocumented option you mention above?

Currently it's only possible through the undocumented option. It will require shell access to the re:dash server, to add the required permission to your user.

As an alternative, I can add tomorrow the `turboThreshold` as a configuration parameter to re:dash. It will require you to upgrade once I do that. http://docs.redash.io/en/latest/upgrade.html


Resolving patch:
diff --git a/redash/handlers/static.py b/redash/handlers/static.py
--- a/redash/handlers/static.py
+++ b/redash/handlers/static.py
@@ -38,7 +38,8 @@ def index(**kwargs):
 
     features = {
         'clientSideMetrics': settings.CLIENT_SIDE_METRICS,
-        'allowScriptsInUserInput': settings.ALLOW_SCRIPTS_IN_USER_INPUT
+        'allowScriptsInUserInput': settings.ALLOW_SCRIPTS_IN_USER_INPUT,
+        'highChartsTurboThreshold': settings.HIGHCHARTS_TURBO_THRESHOLD
     }
 
     return render_template("index.html", user=json.dumps(user), name=settings.NAME,
diff --git a/redash/settings.py b/redash/settings.py
--- a/redash/settings.py
+++ b/redash/settings.py
@@ -142,6 +142,8 @@ def all_settings():
 # Client side toggles:
 ALLOW_SCRIPTS_IN_USER_INPUT = parse_boolean(os.environ.get("REDASH_ALLOW_SCRIPTS_IN_USER_INPUT", "false"))
 CLIENT_SIDE_METRICS = parse_boolean(os.environ.get("REDASH_CLIENT_SIDE_METRICS", "false"))
+# http://api.highcharts.com/highcharts#plotOptions.series.turboThreshold
+HIGHCHARTS_TURBO_THRESHOLD = int(os.environ.get("REDASH_HIGHCHARTS_TURBO_THRESHOLD", "1000"))
 
 # Features:
 FEATURE_ALLOW_ALL_TO_EDIT_QUERIES = parse_boolean(os.environ.get("REDASH_FEATURE_ALLOW_ALL_TO_EDIT", "true"))


Test patch: