+
+
+
+ |
-
-
-
+ /> |
+ {{(weights[weights.length-1]*100).toFixed(1)}}% |
+
+
+ | {{prices[prices.length-1-num]}} |
+ {{(weights[prices.length-1-num]*100).toFixed(1)}}% |
+
+
+
+ |
+ {{weights.length?(weights[0]*100).toFixed(1):''}}% |
+
+
+
Click the chart!
@@ -280,8 +292,6 @@ const rungs = computed({
const prices = computed(()=>{
let a = props.builder.priceA
let b = props.builder.priceB
-
-
const r = props.builder.rungs
// console.log('prices for', a, b, r)
if ( a===null || !r ) return [] // no data
@@ -291,6 +301,7 @@ const prices = computed(()=>{
const result = []
for( let i=0; i {
for (let i = 0; i < n; i++)
result.push((1 - s * (2 * i / (n - 1) - 1)) / n)
}
+ // console.log('weights', result)
return result
})
@@ -348,8 +360,9 @@ function allocationText(weight) {
function adjustShapes() {
// this is where all the lines are created or adjusted
// console.log('adjustShapes()')
- cancelDrawing()
const limits = prices.value
+ if (limits.length)
+ cancelDrawing()
const colorStrings = colors.value
// line properties
const lps = weights.value.map((w)=>{return {text:allocationText(w), textcolor:color.value, showLabel: true}}) // todo make this label innate to HLine with allocation and amount set in the model
@@ -436,5 +449,10 @@ onBeforeUnmount(deleteShapes)
:deep(.v-slider.no-slider-bg .v-slider-track__fill) {
background-color: inherit !important;
}
+td.weight {
+ padding-left: 0.5em;
+ padding-right: 0.5em;
+ text-align: right;
+}