Forum Discussion
SVG Bar Chart within a table
- 6 years ago
That probably means that internally the SVG defaults the chart scale to 100 if no value is given.
In that case you need to provide a dynamic chart scale based on your largest number.
Say, your numbers a and b are 4300 and 3500. Then your chart scale should be a "1" followed by
(int(LOG10(max(number a,number b))+1) "0" strings.
what happens if you use
var chartScale = ""
instead?
Hi, thank you that definately helps, especially for when the numbers are relatively small. However, when BOTH numbers start to get large there appears no difference in the bar size.
As you can see in the example below, it all seems to work, but when both numbers are above 100, but still have a big difference between them the bar sizes show equal ... when clearly there is a difference.
Yours hopefully
Stuart
- lbendlin6 years agoSuper User
That probably means that internally the SVG defaults the chart scale to 100 if no value is given.
In that case you need to provide a dynamic chart scale based on your largest number.
Say, your numbers a and b are 4300 and 3500. Then your chart scale should be a "1" followed by
(int(LOG10(max(number a,number b))+1) "0" strings.
- Sdg84816 years agoHelper I
Thank you that really helped. Your idea of getting the maximum did the trick. Thank you