How to plot rectangular slices in a barchart ? The slice can be plotted anywhere. It should not start from xAxis.
This slice is actually pointing to a corresponding x and y value.The width of the slice remains same as the bars plotted in the barchart.The height is set a very small value to see it as a slice.
The Blue colored is bar chart's bar and brown colored is the slice.
Set barBasesVary to YES on the bar plot. This will cause the plot to query the datasource for an additional field called CPTBarPlotFieldBarBase. The base value defines one end of the bar and the tip value defines the other end. The location determines the horizontal placement (for vertical bars) as always.
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/
I have more than 4 bar charts in a coreplot graph.When the number of charts become more than 3,the charts becomes overlapping and cannot differentiate between the X axis labels.
How to increase the tick space between the x axis labels so that space always remains between the 2 x -axis labels?
The below image is when I have 3 bar charts,then the spacing looks good.
the below image is when I have more charts then there is no spacing between the ticks.
Reduce the barWidth and adjust the barOffset of each plot accordingly. This will allow more bars to fit between each label on the x-axis. You'll also need to reduce the length of the plot space xRange and/or make the graph wider to spread out the plots so the data labels don't overlap.
I am working on an implementation of CorePlot that uses a chart with all white elements on a black view.
The chart is coming along nicely, but I cannot get my axis increment labels to be the correct color. To clarify, the labels for the axis are correct (time and usage) but the labels on the axis tick marks are still in black.
What I currently see:
Changing my view background to white to confirm that the tick labels are there:
I'd appreciate it if someone could point me in the right direction for making the tick mark labels white instead of black, as well as making the horizontal lines that go across the chart white instead of black.
Thanks in advance!
Line styles and text styles both have color properties (lineColor and color, respectively). Use the following axis properties to set the styles:
titleTextStyle: text style for the axis title
labelTextStyle: text style for the labels at the major tick locations
minorTickLabelTextStyle: text style for the labels at the minor tick locations
axisLineStyle: line style for the axis line
majorTickLineStyle: line style for the tick marks at the major tick locations
minorTickLineStyle: line style for the tick marks at the minor tick locations
majorGridLineStyle: line style for the grid lines at the major tick locations
minorGridLineStyle: line style for the grid lines at the minor tick locations
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.
I want to add a label to a core plot scatter chart. It should be at a specific y value at the left edge of the chart, like that:
I tried doing it using annotation but I have a problem with dragging. When I drag the chart the annotation is also being dragged, and I would like it to always stay at the left edge.
Create your label as a plot space annotation. Use a plot space delegate to monitor changes to the xRange and update the x-value of the anchor point as needed. You can use the plot space to convert the desired x-position to the corresponding data value for the anchor point.