Răsfoiți Sursa

increase marker size for line charts

Daniel Sheffield 8 luni în urmă
părinte
comite
1fc3bda304
1 a modificat fișierele cu 9 adăugiri și 1 ștergeri
  1. 9 1
      sqlpage/sqlpage/pages/Trend.sql

+ 9 - 1
sqlpage/sqlpage/pages/Trend.sql

@@ -1,7 +1,12 @@
 SET height = '750';
 SET type = 'line';
+SET marker = 4;
+
 SET unit_count_chart = (SELECT v#>>'{}' FROM json_array_elements($unit_count::json) j(v) LIMIT 1);
-SET display_by_count = (SELECT count(*) FROM json_array_elements($unit_count::json) j(v)) == 1;
+SET display_by_count = (SELECT count(*) FROM json_array_elements($unit_count::json) j(v)) == 1
+AND (EXISTS (SELECT 1 FROM sqlpage_txn WHERE unit = $unit_count_chart LIMIT 1));
+SET display_by_mass = (EXISTS (SELECT 1 FROM sqlpage_txn WHERE unit = $unit_mass LIMIT 1));
+SET display_by_volume = (EXISTS (SELECT 1 FROM sqlpage_txn WHERE unit = $unit_volume LIMIT 1));
 
 SELECT 'chart' AS component
 , 'Cost by Weight' AS title
@@ -11,6 +16,7 @@ SELECT 'chart' AS component
 , $log_scale = 'true' AS logarithmic
 , TRUE AS time
 , 0 AS ymin
+, $marker AS marker
 ;
 SELECT product AS series
 , ts AS x
@@ -28,6 +34,7 @@ SELECT 'chart' AS component
 , $log_scale::bool AS logarithmic
 , TRUE AS time
 , 0 AS ymin
+, $marker AS marker
 ;
 SELECT product AS series
 , ts AS x
@@ -45,6 +52,7 @@ SELECT 'chart' AS component
 , $log_scale::bool AS logarithmic
 , TRUE AS time
 , 0 AS ymin
+, $marker AS marker
 WHERE $display_by_count::bool
 ;
 SELECT product AS series