How to get height of individual bars in column chart of highcharts? - highcharts

Is there a way to find individual bar height? I know chart.plotHeight would return potting area height. Similarly i would like to know individual bar height.

You can find all point's shape arguments in Point.shapeArgs object. Take a look at the example below.
Example:
http://jsfiddle.net/gL9e7mbj/

Related

How to set different bar width in the same series Highchart

In my bar chart the point range is not equally, so I want to draw different widths for bar chart using highchart. However, all the solution is to draw different series. I wonder is there any solution to hack the code and only change the pointwidth inside one series?
Here is a screenshot
The easiest way would be to change width property of a column SVG element.
Example:
http://jsfiddle.net/6o7290uf/

Core Plot horizontal bar chart on negative y-axis

I have a requirement to draw Core Plot horizontal bar chart with everything on the negative y-axis. I.e. the first index should appear at -1, like below:
I have figured out how to draw horizontal Bar Chart. But figuring out how to draw them in an "inverted" manner (to let user scroll downward with the tallest bar on top). My thought:
1) Convert the Y-index to negative
2) offset the Y-axis to the top of the graph instead of bottom
Is there any better way to do it?
I have found a historical article that's similar to my request (core-plot iOS reversed Y axis).
I have got what I needed after using this:
CPTPlotRange plotRangeWithLocation:CPTDecimalFromFloat(-yMax-1) length:CPTDecimalFromFloat(yMax)
P.S. you need to add the -1 to the Location parameter (-yMax-1) otherwise the horizontal bar at index 0 will not be shown clearly.

HighCharts Column Chart Spacing Between Columns

I am creating a column chart using highcharts, I need to specify the width of the column and I am able to achieve that using the plotOptions.column.pointWidth property, after that I need to specify the distance between the columns in pixels, and I don't find anything in the API about it, I tried using plotOptions.column.groupPadding and plotOptions.column.pointPadding but they don't work if the column width is fixed. Please let me know how to achive that.
In addition to specifying the space between columns, I would like to give the columns a background color that spans the entire y-axis.
Do you mean something like in this:
Unfortunately you can set or fixed width for columns (as you are using) or floating width using groupPadding and pointPadding. Highcharts doesn't provide option to set fixed width for bars and between them. You can create an idea here: http://highcharts.uservoice.com/forums/55896-general

Highcharts: Dynamically change single column width to highlight one sample

In a Highcharts column chart we'd like to highlight one value/sample by drawing its column a little bit wider... But this seems not to be possible, is it?
pointWidth only affects the whole series.
Maybe I could overlay a second series, but IMHO that's not a nice solution.
You can also use data attribute and modify width.
http://jsfiddle.net/cDvmy/2/
chart.series[0].data[0].graphic.attr({
width:50
});
I don't see any way to do this with the current API. As an equally not nice solution you could adjust the SVG after the plot is drawn:
// make fifth bar of first series wider
var bar = $($('.highcharts-series').children()[4]);
bar.attr('width',parseInt(bar.attr('width'))+20);
bar.attr('x',parseInt(bar.attr('x'))-10); // keep it centered
Fiddle here.

How to position labels for plotbands on y axis in Highcharts

This Link is a similar example from highcharts.com which i'm working on. I'm trying to place the labels for plot bands on y axis. But as you can see the labels are overlapping on the chart which isn't that good. If i wanna color the labels with the same color of the corresponding plotbands, the label doesn't show up. Is there a way to place it completely outside without overlapping?
Thanks in advance.
A possible solution is to add right margin to the chart, and move the labels over.
Add a marginRight to the chart, and on each label, use x to determine its starting x position.
marginRight:110
and
x: 90 on each label.
http://jsfiddle.net/7xb1Lgx6/ the fiddle.
I think it's not possible to do it yet.
If you add labels to the plotbands it will overlap them.
You can align your labels but if you set x more than your chart width, it will not appear on your chart.
demo

Resources