Is it possible to show the x-axis and corresponding labels on top of the graph instead of the bottom?
Inverting or reversing the data is not what I am looking for design wise.
Yes. In your xAxis properties, set 'opposite:true'
http://api.highcharts.com/highcharts#xAxis.opposite
Related
I have three pie charts displayed in a row. Two have two segments, one has five. All three have vertical legends.
Given that, the chart with five segments displays the pie slightly smaller, due to the extra height of the legend. It also has a slight negative vertical offset.
Is there any way I can set all three charts to render the chart in the same position? I've tried setting the center to 50%,50% in plotOptions, didn't help.
You have to set the marginBottom-Value of the chart to a value that is equal an all charts. Highcharts is trying to display the pie as big as possible, therefore it will use more space if the legend is not as big.
By setting the marginBottom you force the chart to ignore the actual legend size.
The center: ['50%','50%'] setting will only take into account the actual plot area. So if this area is decreased because of a taller legend it has no effect.
I made a jsfiddle where you can explore this settings:
http://jsfiddle.net/doc_snyder/dsmgy6ts/
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/
I try to add data labels to a bar graph in Core-Plot (on iOS). The user selects individual plots and then the values are shown.
The main problem is shown in the image, the other plots overdraw the data labels.
Is it possible to have the labels always at the top?
As the user sets the ordering of the bars, I cannot reorder the bars. (Also if I did, the user experience would be terrible as the whole graph appearance would change on selection.)
Other possibility: Can I reorder the plots for Z-ordering but have the positions remain unchanged?
Any other ideas? I also tried CPTPlotSpaceAnnotations, but I cannot align them on the bar precise enough (see the "1037" label at the year (x-axis) 1980).
I came up with a solution by myself: I just remove the plot and add it back. In that way the plot is raised in the z-Hierarchy.
[self.graph removePlot:plot];
[self.graph addPlot:plot];
I'm trying to customize a Coreplot graph in many ways I can and the next thing I would like to do is place the X Axis Labels (one that is custom as well) at the bottom of the graph, independent of the X axis' position (whether it's scrolled up or down).
To make it clear, it is similar to giving the labels an offset value of something like 50.0. But offset is not the property I'm looking for since it fixes the labels location relative to the X axis.
Any way this can be done? Or do I have to skip the axisLabels property and place and layer or something manually at the bottom of the graph?
EDIT: Alright, I managed to place an axis on the bottom with CPTConstraints. But it's not on the bottommost. If a plot point is on those levels, the plot line overlaps the labels. I tired padding of the graph but of course, it moves the whole graph, hence the issue persists.
Thanks in advance
Make a second x-axis. Have the first one draw the axis line, tick marks, etc., as normal but no labels. Label the second one and set all of the line style properties to nil so it doesn't draw any of the lines.
Turns out that aside from the graph, the plotAreaFrame property of the CPTGrpah also has paddings. If you give more paddings to plotAreaFrame than that of the graph, the plot will be drawn in a smaller frame and the rest of the graph area will be for you to add what you want (i.e., a second Axis).
Big thanks to #Eric, for trying to answer Every single CorePlot question as soon as possible.
CorePlot does have a lot of customisation than I thought.
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.