Skip to content

Commit

Permalink
tidying up comments, variable names
Browse files Browse the repository at this point in the history
  • Loading branch information
PhillipsOwen committed Jul 19, 2024
1 parent d3decef commit 2a2e62a
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions src/components/dialog/observation-chart.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,24 +151,18 @@ function csvToJSON(csvData) {
/**
* reformats the data label shown on the x-axis
*
* @param time
* @param value
* @returns {string}
*/
function formatY_axis(value) {
// init the return value
let ret_val = "";

// do the reformatting
ret_val = value.toFixed(2);

// return the formatted value
return ret_val;
return value.toFixed(2);
}

/**
* reformats the data label shown on the x-axis
*
* @param time
* @param value
* @returns {string}
*/
function formatX_axis(value) {
Expand Down Expand Up @@ -208,7 +202,7 @@ function CreateObsChart(url) {
) : (
<LineChart data={ data } margin={{ left: -25 }}>
<CartesianGrid strokeDasharray="1 1" />
<XAxis tickCount="2" tick={{ stroke: 'tan', strokeWidth: .5 }} tickSize="10" dataKey="time" tickFormatter={ (time) => formatX_axis(time) }/>
<XAxis tickCount="2" tick={{ stroke: 'tan', strokeWidth: .5 }} tickSize="10" dataKey="time" tickFormatter={ (value) => formatX_axis(value) }/>
<YAxis tickCount="10" tick={{ stroke: 'tan', strokeWidth: .5 }} tickFormatter={ (value) => formatY_axis(value) } domain={ obsChartY } />
<Tooltip />
<Legend align="right"/>
Expand Down

0 comments on commit 2a2e62a

Please sign in to comment.