I've been playing around with a highcharts bar chart and noticed some strange behavior. If I have a long name in the x axis (the categories), and if I have labels enabled to show up on the bars, not all the labels will appear. If I remove the long x axis name, then the label that wasn't appearing on the bar before will suddenly appear. I have a working Jsfiddle example here:
https://jsfiddle.net/p55t0bmf/ (notice label isn't appearing for one of the bars, should say 5 but nothing is there)
I placed a long name in the categories section to trigger this behavior:
xAxis: {
categories: ["LONG NAME THAT WILL BREAK US"]
}
Does anyone know why this would be happening, and is there a way to fix this behavior (without resorting to short x axis names of course)?
Set allowOverlap to true. When you have longer xAxis labels, then you have less horizontal space. Labels have padding which can overlap and hide some of them. Anyway, your demo works for me exactly the same way with or without long xAxis category.
Demo with all labels: https://jsfiddle.net/p55t0bmf/1/
stacking option cause this problem. If you set the stacking, then highchart change the label opacity automatically.
Solution : Remove stacking options from chart, if you dont need or write css to override label opacity.
Related
Is it possible to show the value labels of the y-value below the x-axis instead of showing them inside the chart in Rechart? I have found nothing similar to this in the examples on the Recharts page and the API does not have options for this either. (At least I didn't find them) An example of what I mean is in the link below.
value labels below x-axis
Use the "position" prop with only "y" value to set the position along Y-Axis. This will only fix the Y-Axis position and the X-Axis would change, hence giving you the Tooltip the way you require.
In my highstock charts i required label on the left side of the graphs. When i used opposite: false + align: left for labels they are positioned above graph. But i want to start graph rendering after labels ends.
Left side labels without required graph render
I saw solution for my problem in Highcharts not in highstock some time before. But now i cant find it to show what exactly i need
Expected result
Thanks in advance
OK, so you want the labels inside the plot area.
You can do this by adding
labels: {
align: 'left',
x: 0
}
to your yAxis properties.
This moves the starting point of the labels to the axis line, and extends the labels to the right from that point. If you want them pushed further inside, just increase x.
The problem that you'll run into is that the plot will not respect the label placement - your line will still start at the same point, as if the labels weren't there.
Normally, you could just use the minPadding setting on the xAxis to increase the space for the labels, but this doesn't work in the case of the navigator, as explained here:
http://api.highcharts.com/highstock/xAxis.minPadding
When the axis' min option is set or a min extreme is set using axis.setExtremes(), the minPadding will be ignored
I am sure there is some work around for this problem, but I do not have the solution currently.
Updated fiddle:
http://jsfiddle.net/d6mre68v/
I used the multiple axes on the highchart
During Zoom operation the x values are getting hidden
I used linked to attribute also
JsFiddle
zoomType: 'y',
zoomType: String
Decides in what dimensions the user can zoom by dragging the mouse. Can be one of x, y or xy.
Try it:
None by default
x
y
xy
I referred this jsfiddle to figure out what's happening. I think, this behavior is not a bug/issue.
This github issue mentioned in comments is not the problem here. Because what it is saying is to use linkedTo: 0 which is already present in this example.
It actually depends on how much area and more importantly from where to where you select for zooming in. Let's see that by examples:
In the following image, the rectangle signifies the width of one column.
Now, if you start your pinch from more than half of the width of any column or end the pinch after half of the width of a column, that column would be fully visible along with x-Axis labels.
But, if you pinch any less, say from the middle of orange bar of first column, till middle of next column's blue bar, it's not going to show whole columns and hence it ends up with hidden x-Axis labels.
I'd like to display a "total amount" and a "filtered amount" on a bar chart. A stacked bar chart doesn't quite work because it shows both amounts in full on top of one another; in this case I'd like it to appear as though the bar has been "filtered", so the "remaining/filtered" amount is greyed out. amCharts lets you do this by setting clustered: false. Is it possible in Chart.js?
Here's an example of the functionality I'm trying to build -- the bar chart on the right is the desired appearance (using amCharts).
You can set stacked: true inside xAxes and leave yAxes alone to get this effect.
I'm trying to make a toggleable axis using nvd3s charts, specifically the line chart example. After running this example, opening the console, and typing chart.setXAxis(false) the x axis does not hide. Is there some documentation or some reason why this isn't working? It doesn't seem to work for any boolean either.. once it's true, it's not changeable to false.
setXAxis just tells the chart function whether or not to draw the axis when it draws the chart, it doesn't do anything to the existing axis. You'd be better off just selecting the axis directly and changing its visibility style.
Given the class names that NVD3 uses for it's axes, to hide the x-axis you would use:
d3.select("g.nv-axis.nv-x").style("visibility", "hidden")
That hides the axis, but doesn't delete it, so you can easily re-show it again (without updating the chart) with the same select statement but visibility style visible.