Skip to content

Commit

Permalink
Ticks every 10^n
Browse files Browse the repository at this point in the history
  • Loading branch information
carneirofc committed Jul 10, 2020
1 parent fceb2f2 commit 4e5d5f7
Showing 1 changed file with 18 additions and 5 deletions.
23 changes: 18 additions & 5 deletions src/components/PressureBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class PressureBar extends React.Component {

this.values = pvs.map(pv => {
try{
return this.epics.pvData[pv].value.toExponential(2);
return this.epics.pvData[pv].value.toExponential(1);

}catch(e){
return this.epics.pvData[pv].value;
Expand All @@ -67,7 +67,7 @@ class PressureBar extends React.Component {
return color.MAJOR_BG;
}
} else {
/** I'm returning OK here so because invalid numbers will not be plotted
/** I'm returning OK here because invalid numbers will not be plotted
* so this will only mess up the legend in case the first PV is invalid */
return color.OK_BG;
}
Expand Down Expand Up @@ -176,11 +176,25 @@ class PressureBar extends React.Component {
},
ticks: {
maxTicksLimit: 100,
min: 1e-12,
min: 5e-12,
max: maxVal,
fontSize: 14,
stepSize: step,
//stepSize: step,
beginAtZero: false,
callback: function(label, index, labels) {
switch(label){
case 1e-12:
case 1e-11:
case 1e-10:
case 1e-9:
case 1e-8:
case 1e-7:
case 1e-6:
return label;
default:
return "";
}
}
},
display: true,
type: 'logarithmic',
Expand All @@ -201,7 +215,6 @@ class PressureBar extends React.Component {

this.setState((state, props) => {
const { pvs } = props;
console.log("HandleConfig",hihi,high,step);
return {
minorVal: high,
majorVal: hihi,
Expand Down

0 comments on commit 4e5d5f7

Please sign in to comment.