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