Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using two different unit labels on the scale on the same linear gauge #253

Open
scstraus opened this issue Feb 15, 2022 · 0 comments
Open

Comments

@scstraus
Copy link

scstraus commented Feb 15, 2022

Hello and thank you for putting such a very useful set of widgets out into the world. I had a quick question which I fear the answer to is simply "no", but wanted to double check with you first.

I have a use case which requires a gauge which gives me values in two different units on the same gauge. The easiest way to explain it would be to imagine the example gauge code listed below (which I copied verbatim from the last example on your examples page), but instead of having it show the units only in Celsius, I would want it to have Celsius units listed on the top and Fahrenheit units listed on the bottom.

As there are already two scales with ticks and labels, one on top and one on the bottom of the gauge, it's more or less ready to do this, it just needs the ability to define those ticks and units differently for the two scales.

If it's not possible, please feel free just to say "nope, sorry, not possible" and close it, or if you are feeling ambitious, you are welcome to take it as a feature request :-).

<canvas data-type="linear-gauge"
    data-width="400"
    data-height="150"
    data-units="°C"
    data-title="Temperature"
    data-min-value="-50"
    data-max-value="50"
    data-major-ticks="[-50,-40,-30,-20,-10,0,10,20,30,40,50]"
    data-minor-ticks="5"
    data-stroke-ticks="true"
    data-ticks-width="15"
    data-ticks-width-minor="7.5"
    data-highlights='[ {"from": -50, "to": 0, "color": "rgba(0,0, 255, .3)"},
        {"from": 0, "to": 50, "color": "rgba(255, 0, 0, .3)"} ]'
    data-color-major-ticks="#ffe66a"
    data-color-minor-ticks="#ffe66a"
    data-color-title="#eee"
    data-color-units="#ccc"
    data-color-numbers="#eee"
    data-color-plate="#2465c0"
    data-color-plate-end="#327ac0"
    data-border-shadow-width="0"
    data-borders="false"
    data-border-radius="10"
    data-needle-type="arrow"
    data-needle-width="3"
    data-animation-duration="1500"
    data-animation-rule="linear"
    data-color-needle="#222"
    data-color-needle-end=""
    data-color-bar-progress="#327ac0"
    data-color-bar="#f5f5f5"
    data-bar-stroke="0"
    data-bar-width="8"
    data-bar-begin-circle="false"
></canvas>
@scstraus scstraus changed the title Using two different unit labels on the scale on the same linear guage Using two different unit labels on the scale on the same linear gauge Feb 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant