It is currently Sun Oct 26, 2014 7:08 am Advanced search

Bar chart with low attribute starts 1 pixel before the axis

Technical support, bug reports and more.

Bar chart with low attribute starts 1 pixel before the axis

Postby b283 » Mon Feb 20, 2012 1:22 pm

Hello,

With the 'low' functionality, bar chart looks ugly. The bars start 1 pixel before the axis line.

Column chart is correct.

http://jsfiddle.net/b283/JRM32/

Thank you
b283
 
Posts: 25
Joined: Tue Aug 30, 2011 4:34 pm

Re: Bar chart with low attribute starts 1 pixel before the a

Postby Fusher » Mon Feb 20, 2012 3:02 pm

In HighCharts 2.1.9 it could be done with
Code: Select all
    yAxis: { 
        minPadding:-0.05           
    }

Haven't found the solution for version 2.2
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7388
Joined: Mon Jan 30, 2012 12:16 pm

Re: Bar chart with low attribute starts 1 pixel before the a

Postby Fusher » Wed Feb 22, 2012 1:49 pm

Hi, sorry for late reply. To fix it use 'offset' xAxis. Fro example = 1. http://www.highcharts.com/ref/#xAxis--offset
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7388
Joined: Mon Jan 30, 2012 12:16 pm

Re: Bar chart with low attribute starts 1 pixel before the a

Postby b283 » Wed Feb 22, 2012 3:12 pm

Hello,

I set offset to 1.

The X-axis line and the grid line make a 2 pixels line.
Because it's not the same color, I can't simply remove the X-axis line.

Is there a way to remove the first grid line?

http://jsfiddle.net/b283/JRM32/3/

Thanks
b283
 
Posts: 25
Joined: Tue Aug 30, 2011 4:34 pm

Re: Bar chart with low attribute starts 1 pixel before the a

Postby Fusher » Wed Feb 22, 2012 3:47 pm

You can plot white line:
Code: Select all
    yAxis: {
        plotLines: [{
            color: '#ffffff',
            value: 0,
            width: 2,
            zIndex: 2
        }]       
    }


Example: http://jsfiddle.net/CrPTQ/
Of course it's only a workaround..
Paweł Fus
Highcharts support team
Fusher
 
Posts: 7388
Joined: Mon Jan 30, 2012 12:16 pm

Re: Bar chart with low attribute starts 1 pixel before the a

Postby b283 » Wed Feb 22, 2012 5:56 pm

Hi,

Another workaround, we are prefering now, is to make the lineWidth at 2.

http://jsfiddle.net/b283/JRM32/4/

It will be more consistent because of the colors.

Thanks again.
b283
 
Posts: 25
Joined: Tue Aug 30, 2011 4:34 pm


Return to Highcharts Usage

Who is online

Users browsing this forum: Google [Bot] and 3 guests