bernii / gauge.js

100% native and cool looking JavaScript gauge
MIT License
1.42k stars 391 forks source link

Extend to add ticks #153

Closed Knight2601 closed 6 years ago

Knight2601 commented 6 years ago

added renderTicks

      renderTicks: {
        divisions: 6,
        divLength: .5,
        divColor: '#fff',
        divWidth: 2,
        subDivisions: 4, 
        subLength: .3,
        subColor: '#fff',
        subWidth: 0.6
      },

subTicks are optional as are ticks if the renderTicks is not present image

see Index.html for example

Knight2601 commented 6 years ago

is it worth me nesting divisions so you can go n deep? e.g.

renderTicks: {
  divisions: {
        divisionCount: 6,
        divLength: .7,
        divColor: '#fff',
        divWidth: 2,
        divisions: {
           divisionCount: 4,
           divLength: .5,
           divColor: '#e8e8e8',
           divWidth: 1.2,
           divisions: {
              divisionCount: 2,
              divLength: .3,
              divColor: '#ccc',
              divWidth: 0.7
           } 
        }
  }
}
Knight2601 commented 6 years ago

Hi

  1. I don’t know why I use VS Code’s git extensions, that was excluded from the repo, deleted and pushed ( I was testing the render stack while bug fixing the pointer render issue).
  2. If you fixed them in your gh-pages PR then yes - as this is built on top of that.

Yeah I agree about the coffee issue, I have to deal with polyfills quite often with client systems so wouldn’t want to impose anything like that, but I wouldn’t think that it would be an issue as coffee compiles out to JS anyway, so 90% of the systems that consume this would be using the JSmin version anyhow...

have you pulled and seen this working locally? its a quite nice addition to an awesome gauge library :)

RobbieTheWagner commented 6 years ago

Is there going to be a release that includes this?