how to show specific tick value on highchart gauge?









up vote
0
down vote

favorite












I want to show the value between the green and yellow and red plotBands.



in the example attached i want to show the values 135,172 (where the color are changing)



yAxis: 
min: 0,
max: 200,

minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',

tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels:
step: 2,
rotation: 'auto'
,
title:
text: 'km/h'
,
plotBands: [
from: 0,
to: 135,
color: '#55BF3B' // green
,
from: 135,
to: 172,
color: '#DDDF0D' // yellow
,
from: 172,
to: 200,
color: '#DF5353' // red
]
,


Working Example In JSFiddle



enter image description here










share|improve this question

















  • 1




    Like this: jsfiddle.net/ewolden/08grxtqs/10?
    – ewolden
    Nov 7 at 13:10










  • @ewolden can i see the tick values and add the fix ones? 0,20,40,60,80,100,120,140,160,180,200(the calculate by the chart) and add my (135,172)
    – eyalb
    Nov 8 at 8:36










  • Like this: jsfiddle.net/ewolden/08grxtqs/21? This has ticks for every 20, and makes sure labels are not overlaping.
    – ewolden
    Nov 8 at 8:47














up vote
0
down vote

favorite












I want to show the value between the green and yellow and red plotBands.



in the example attached i want to show the values 135,172 (where the color are changing)



yAxis: 
min: 0,
max: 200,

minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',

tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels:
step: 2,
rotation: 'auto'
,
title:
text: 'km/h'
,
plotBands: [
from: 0,
to: 135,
color: '#55BF3B' // green
,
from: 135,
to: 172,
color: '#DDDF0D' // yellow
,
from: 172,
to: 200,
color: '#DF5353' // red
]
,


Working Example In JSFiddle



enter image description here










share|improve this question

















  • 1




    Like this: jsfiddle.net/ewolden/08grxtqs/10?
    – ewolden
    Nov 7 at 13:10










  • @ewolden can i see the tick values and add the fix ones? 0,20,40,60,80,100,120,140,160,180,200(the calculate by the chart) and add my (135,172)
    – eyalb
    Nov 8 at 8:36










  • Like this: jsfiddle.net/ewolden/08grxtqs/21? This has ticks for every 20, and makes sure labels are not overlaping.
    – ewolden
    Nov 8 at 8:47












up vote
0
down vote

favorite









up vote
0
down vote

favorite











I want to show the value between the green and yellow and red plotBands.



in the example attached i want to show the values 135,172 (where the color are changing)



yAxis: 
min: 0,
max: 200,

minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',

tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels:
step: 2,
rotation: 'auto'
,
title:
text: 'km/h'
,
plotBands: [
from: 0,
to: 135,
color: '#55BF3B' // green
,
from: 135,
to: 172,
color: '#DDDF0D' // yellow
,
from: 172,
to: 200,
color: '#DF5353' // red
]
,


Working Example In JSFiddle



enter image description here










share|improve this question













I want to show the value between the green and yellow and red plotBands.



in the example attached i want to show the values 135,172 (where the color are changing)



yAxis: 
min: 0,
max: 200,

minorTickInterval: 'auto',
minorTickWidth: 1,
minorTickLength: 10,
minorTickPosition: 'inside',
minorTickColor: '#666',

tickPixelInterval: 30,
tickWidth: 2,
tickPosition: 'inside',
tickLength: 10,
tickColor: '#666',
labels:
step: 2,
rotation: 'auto'
,
title:
text: 'km/h'
,
plotBands: [
from: 0,
to: 135,
color: '#55BF3B' // green
,
from: 135,
to: 172,
color: '#DDDF0D' // yellow
,
from: 172,
to: 200,
color: '#DF5353' // red
]
,


Working Example In JSFiddle



enter image description here







highcharts gauge






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Nov 7 at 12:46









eyalb

1,55282956




1,55282956







  • 1




    Like this: jsfiddle.net/ewolden/08grxtqs/10?
    – ewolden
    Nov 7 at 13:10










  • @ewolden can i see the tick values and add the fix ones? 0,20,40,60,80,100,120,140,160,180,200(the calculate by the chart) and add my (135,172)
    – eyalb
    Nov 8 at 8:36










  • Like this: jsfiddle.net/ewolden/08grxtqs/21? This has ticks for every 20, and makes sure labels are not overlaping.
    – ewolden
    Nov 8 at 8:47












  • 1




    Like this: jsfiddle.net/ewolden/08grxtqs/10?
    – ewolden
    Nov 7 at 13:10










  • @ewolden can i see the tick values and add the fix ones? 0,20,40,60,80,100,120,140,160,180,200(the calculate by the chart) and add my (135,172)
    – eyalb
    Nov 8 at 8:36










  • Like this: jsfiddle.net/ewolden/08grxtqs/21? This has ticks for every 20, and makes sure labels are not overlaping.
    – ewolden
    Nov 8 at 8:47







1




1




Like this: jsfiddle.net/ewolden/08grxtqs/10?
– ewolden
Nov 7 at 13:10




Like this: jsfiddle.net/ewolden/08grxtqs/10?
– ewolden
Nov 7 at 13:10












@ewolden can i see the tick values and add the fix ones? 0,20,40,60,80,100,120,140,160,180,200(the calculate by the chart) and add my (135,172)
– eyalb
Nov 8 at 8:36




@ewolden can i see the tick values and add the fix ones? 0,20,40,60,80,100,120,140,160,180,200(the calculate by the chart) and add my (135,172)
– eyalb
Nov 8 at 8:36












Like this: jsfiddle.net/ewolden/08grxtqs/21? This has ticks for every 20, and makes sure labels are not overlaping.
– ewolden
Nov 8 at 8:47




Like this: jsfiddle.net/ewolden/08grxtqs/21? This has ticks for every 20, and makes sure labels are not overlaping.
– ewolden
Nov 8 at 8:47












1 Answer
1






active

oldest

votes

















up vote
0
down vote













You can use tickPositioner function to define which ticks will be shown on the chart:



 tickPositioner: function() 
var plotBands = this.options.plotBands,
ticks = ,
i = 0;

for (i; i <= 200; i += 20)
ticks.push(i);


for (i = 0; i < plotBands.length - 1; i++)
ticks.push(plotBands[i].to)

return ticks;



Live demo: https://jsfiddle.net/BlackLabel/1kpt7dws/



API: https://api.highcharts.com/highcharts/yAxis.tickPositioner






share|improve this answer




















    Your Answer






    StackExchange.ifUsing("editor", function ()
    StackExchange.using("externalEditor", function ()
    StackExchange.using("snippets", function ()
    StackExchange.snippets.init();
    );
    );
    , "code-snippets");

    StackExchange.ready(function()
    var channelOptions =
    tags: "".split(" "),
    id: "1"
    ;
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function()
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled)
    StackExchange.using("snippets", function()
    createEditor();
    );

    else
    createEditor();

    );

    function createEditor()
    StackExchange.prepareEditor(
    heartbeatType: 'answer',
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader:
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    ,
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    );



    );













     

    draft saved


    draft discarded


















    StackExchange.ready(
    function ()
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189731%2fhow-to-show-specific-tick-value-on-highchart-gauge%23new-answer', 'question_page');

    );

    Post as a guest






























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    0
    down vote













    You can use tickPositioner function to define which ticks will be shown on the chart:



     tickPositioner: function() 
    var plotBands = this.options.plotBands,
    ticks = ,
    i = 0;

    for (i; i <= 200; i += 20)
    ticks.push(i);


    for (i = 0; i < plotBands.length - 1; i++)
    ticks.push(plotBands[i].to)

    return ticks;



    Live demo: https://jsfiddle.net/BlackLabel/1kpt7dws/



    API: https://api.highcharts.com/highcharts/yAxis.tickPositioner






    share|improve this answer
























      up vote
      0
      down vote













      You can use tickPositioner function to define which ticks will be shown on the chart:



       tickPositioner: function() 
      var plotBands = this.options.plotBands,
      ticks = ,
      i = 0;

      for (i; i <= 200; i += 20)
      ticks.push(i);


      for (i = 0; i < plotBands.length - 1; i++)
      ticks.push(plotBands[i].to)

      return ticks;



      Live demo: https://jsfiddle.net/BlackLabel/1kpt7dws/



      API: https://api.highcharts.com/highcharts/yAxis.tickPositioner






      share|improve this answer






















        up vote
        0
        down vote










        up vote
        0
        down vote









        You can use tickPositioner function to define which ticks will be shown on the chart:



         tickPositioner: function() 
        var plotBands = this.options.plotBands,
        ticks = ,
        i = 0;

        for (i; i <= 200; i += 20)
        ticks.push(i);


        for (i = 0; i < plotBands.length - 1; i++)
        ticks.push(plotBands[i].to)

        return ticks;



        Live demo: https://jsfiddle.net/BlackLabel/1kpt7dws/



        API: https://api.highcharts.com/highcharts/yAxis.tickPositioner






        share|improve this answer












        You can use tickPositioner function to define which ticks will be shown on the chart:



         tickPositioner: function() 
        var plotBands = this.options.plotBands,
        ticks = ,
        i = 0;

        for (i; i <= 200; i += 20)
        ticks.push(i);


        for (i = 0; i < plotBands.length - 1; i++)
        ticks.push(plotBands[i].to)

        return ticks;



        Live demo: https://jsfiddle.net/BlackLabel/1kpt7dws/



        API: https://api.highcharts.com/highcharts/yAxis.tickPositioner







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 9 at 14:02









        ppotaczek

        2,978119




        2,978119



























             

            draft saved


            draft discarded















































             


            draft saved


            draft discarded














            StackExchange.ready(
            function ()
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53189731%2fhow-to-show-specific-tick-value-on-highchart-gauge%23new-answer', 'question_page');

            );

            Post as a guest














































































            Popular posts from this blog

            Use pre created SQLite database for Android project in kotlin

            Darth Vader #20

            Ondo