Git Product home page Git Product logo

Comments (4)

Mikhus avatar Mikhus commented on August 21, 2024 1

Hi. Gauge is drown on a canvas, so it's a bitmap and does not have any relation to CSS. As a result there is no way to hide specific ticks unless changing drawing algorithm itself. So within core implementation it is currently not possible.

from canvas-gauges.

Mikhus avatar Mikhus commented on August 21, 2024 1

It is opensource under MIT license, so, please, feel free to do any modifications. There is no limits, so you can fork, modify and pull your changes. All that is highly appreciated!

from canvas-gauges.

sotabound avatar sotabound commented on August 21, 2024

Hi Mikhus, thanks for the reply. I probably used CSS when I did not need to. I looked more deeply in your code and I found that the config changes all of the Major ticks and not just one. I understand that it would be difficult to extend the config on the "strokeStyle" of the majorTicks (ctx.strokeStyle = config.colors.majorTicks;). What if I wanted to do something like the following:
majorTicks: [{tick:'0', color:'#000000'}, '10', '20', '30', '40', '50', '60', '70', '80', '90', '100'],

Could I extend your library to change the configuration? I would prefer not to change the code in gauge.js, however maybe I could create a "plugin" of sorts that could extend it and apply what I am describing?

I think you have done an excellent job of making these gauges possible using html5 canvas! Very very cool stuff, keep up the great work!

from canvas-gauges.

Mikhus avatar Mikhus commented on August 21, 2024

This feature will be added in upcoming release 2.0.4. It will be possible to specify specific colors for major ticks and tick numbers separately as arrays of colors instead of a single color value. For example:

<canvas data-type="radial-gauge"
               data-major-ticks="0,50,100,150,200"
               data-color-numbers="transparent,red,green,blue,black"
               data-color-major-ticks="black,red,green,blue,black"
></canvas>

from canvas-gauges.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.