Enhancement idea: Can we improve things with css attr
values?
#81
Replies: 1 comment
-
When I started developing Charts.CSS I tested all the available methods. There where several use cases where In your example, the When you prefer to display stacked chart, you need to change the "total" value. Read the stacked docs, and see the examples on the Simple vs. Percentage section. In addition, when using CSS variables, you can use math functions everywhere. With data attributes you have to use static value. You can't use calculations like |
Beta Was this translation helpful? Give feedback.
-
Looking at the samples
<td style="--size: calc( 60 / 100 );"> $ 60K </td>
might be more semantically valuable if we did something like<td data-value="60" data-total="100" style="--size: calc( attr("data-value") / attr("data-total");"> $ 60K </td>
or something similar... and we could have the default style for size be implicitly thatcalc
and do similar for--start
. Also would be cool to be able to reach up for thedata-total
value using the cascading of CSS ;)Beta Was this translation helpful? Give feedback.
All reactions