Skip to content

Commit

Permalink
add display units to y axis
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelPesce committed Apr 11, 2024
1 parent 11ec950 commit f47f04b
Showing 1 changed file with 3 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ export default function OutputComparisonChart(props) {
let traces = []
let x = []
let ys = []
let displayUnits
// x: the configuration names; will be the same for each trace
// y: the values for each y variable
for(let config of historyData) {
Expand All @@ -58,6 +59,7 @@ export default function OutputComparisonChart(props) {
y.push(round(config.raw.data[yVariable].value, 3))
}
yNames.push(`${historyData[0].raw.data[yVariable].name} (${historyData[0].raw.data[yVariable].display_units})`)
displayUnits = historyData[0].raw.data[yVariable].display_units
ys.push(y)
}
// console.log(ys)
Expand All @@ -81,7 +83,7 @@ export default function OutputComparisonChart(props) {
},
yaxis: {
title: {
text: displayCategory,
text: `${displayCategory} (${displayUnits})`,
},
},
width: 700,
Expand Down Expand Up @@ -117,14 +119,6 @@ export default function OutputComparisonChart(props) {
},
}}
>
{/* {Object.keys(historyData[0].data).map((k) => (
<MenuItem
key={`${k}`}
value={k}
>
{k}
</MenuItem>
))} */}
{categoriesWithCharts.map((v, idx) => (
<MenuItem
key={`${v}_${idx}`}
Expand Down

0 comments on commit f47f04b

Please sign in to comment.