0
votes

I am using highchart to get bar chart, i have used plotbands here so my requirement is i need to get the plotband only for the one row xaxis. here it is the snippet for example. https://jsfiddle.net/z6kug43w/20/

xAxis: {
    plotBands: [{
        from: 0.4,
      to: 0.6,
      color: '#fff',                     
      zIndex: 3
    },
    {
        from: 1.4,
      to: 1.6,
      color: '#fff',                     
      zIndex: 3
    },
    {
        from: 2.4,
      to: 2.6,
      color: '#fff',                     
      zIndex: 3
    },
    {
        from: 3.4,
      to: 3.6,
      color: '#fff',                     
      zIndex: 3
    }],
    categories: ["abc (1%)", "abcd (1%)", "abce (1%)", "abcf (1%)", "abcg (1%)", "abch (1%)"],
    crosshair: true
},

yAxis: { min: 0, plotBands: [{ from: 0, to: 100, thickness: '2%', color: '#D5D5D6' }], title: { text: 'Rainfall (mm)' } },

1
can you share any image that you want to plot ? - Faker Makes Actual Correct
Hi @FakerMakesActualCorrect, Thanks for helping me here, i have shared that image in description. that i want to plot only top level of the graph. - shirisha
What's the difference both image are same ? - Faker Makes Actual Correct
like in the image i want the plot band for top level for now it is getting for all the xaxis rows as in the example jsfiddle.net/z6kug43w/20. Just uploaded once again for you i thought image is not visible, please ignore the second one. - shirisha

1 Answers

0
votes

Please take a look at this custom plugin which allows you to defining the low and high values for the plotBands.

Demo: https://jsfiddle.net/BlackLabel/n3okxjug/

  xAxis: {
    categories: ["abc (1%)", "abcd (1%)", "abce (1%)", "abcf (1%)", "abcg (1%)", "abch (1%)"],
    crosshair: true,
    plotBands: [{
      from: 0.5,
      to: 1.5,
      color: 'red',
      low: '60%',
      high: '100%'
    }]
  },

Is this a result which you wanted to achieve?