[Rt-commit] rt branch, 4.4/configurable-chart-y-axis, created. rt-4.4.3-79-g76c5fb2e6

Craig Kaiser craig at bestpractical.com
Thu Nov 29 16:41:57 EST 2018


The branch, 4.4/configurable-chart-y-axis has been created
        at  76c5fb2e6b050b43737445a847aab75499935cef (commit)

- Log -----------------------------------------------------------------
commit 76c5fb2e6b050b43737445a847aab75499935cef
Author: Craig Kaiser <craig at bestpractical.com>
Date:   Thu Nov 29 11:03:35 2018 -0500

    Make the Y axis for charts Min and Max value configurable from web UI

diff --git a/share/html/Search/Chart b/share/html/Search/Chart
index f4d618ffb..378ac7a29 100644
--- a/share/html/Search/Chart
+++ b/share/html/Search/Chart
@@ -119,8 +119,8 @@ if ( $Cache and my $data = delete $session{'charts_cache'}{ $Cache } ) {
 }
 
 my @data = ([],[]);
-my $max_value = 0;
-my $min_value;
+my $max_value = $ARGS{ChartMax} ? $ARGS{ChartMax} : 0;
+my $min_value = $ARGS{ChartMin} ? $ARGS{ChartMin} : undef;
 my $max_key_length = 0;
 while ( my $entry = $report->Next ) {
     push @{ $data[0] }, [ map $entry->LabelValue( $_ ), @{ $columns{'Groups'} } ];
diff --git a/share/html/Search/Chart.html b/share/html/Search/Chart.html
index 50266049b..feda04ae2 100644
--- a/share/html/Search/Chart.html
+++ b/share/html/Search/Chart.html
@@ -217,6 +217,17 @@ jQuery(".chart-picture [name=ChartStyleIncludeTable]").change( updateChartStyle
 jQuery(".chart-picture [name=ChartStyleIncludeSQL]").change( updateChartStyle );
 </script>
 
+<&| /Widgets/TitleBox, title => loc('Chart Axis Options') &>
+<div>
+    <label>Chart Y Min Value:</label>
+    <input style="width: 50px;" size="4px" type="number" name="ChartMin" value="<% $ARGS{ChartMin} %>" />
+</div>
+<div>
+    <label>Chart Y Max Value:</label>
+    <input style="width: 50px;" type="number" name="ChartMax" value="<% $ARGS{ChartMax} %>" />
+</div>
+</&>
+
 <& /Elements/Submit, Label => loc('Update Chart'), Name => 'Update' &>
 </form>
 

-----------------------------------------------------------------------


More information about the rt-commit mailing list