I'm using Shinobi Controls Charts to do this project and i'm having some trouble to find ou how to customise my chart to look as close as possible to this:
Here is what i have so far:
The labels at the bottom are the ones that are represented as [name] in the first chart.
The colores of the bars are ok i know how to change them. My problem resides on the labels on the top of each bar and the grid and background grid.
1) How can i remove the grid and change the graph color to transparant? chart.xAxis.style.gridStripeStyle.showGridStripes = NO; does not remove the grid.
2) The radial series had a callback where i could change the labels position, but after taking a look at all the documentation that comes with the demo i can't find anything to change the position of the axis's labels for a bar graph and add more complexity like an image and 2 or 3 labels to it. Also those boxes have to move along with bars.
Does anyone know how to do this 2 topics?
Thank you in advance for any given help.
EDIT :
I've been able to remove the axis with
axis.style.gridStripeStyle.showGridStripes = NO; // removes the main bar
axis.style.majorGridLineStyle.showMajorGridLines = NO; // removes the grid bars
Regarding your second point, use
- (void)sChart:(ShinobiChart *)chart alterTickMark:(SChartTickMark *)tickMark
beforeAddingToAxis:(SChartAxis *)axis
Regarding your first point use
chart.axis.style.majorGridLineStyle.showMajorGridLines = NO
Related
I spent more than half of my day on it and unable to figure out solution
drawing bar chart using Charts pod facing two problems
Wanna Corner radius bars as mentioned in required Image
wanna bars besides the grid line as in below image
Required
My output is something like this
Output
Two method
override XAxisRender to make offset x grid line. override BarChartRenderer to add round corner
use ChartLimitLine instead of x grid line. and fork Chart and change BarChartRenderer to implement round corner
this is my demo implemented all you want with method 2
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 have chart showing time data. I have two points back in time which I need to "mark" in the chart.
I currently indicate these two by plotlines, but would like to show bar, with let's say green and blue bars showing the timespans (for example -13days from now with blue and -90days -> -13days with red).
I would use plotBands, but I can't specify their height and do not want to have them all over the chart.
Is there some way? I saw something about translating pixels and drawing rectangle, but wasn't able to make it work. Also - I zoom a lot in this chart.
You can use Renderer and add custom shape. In other cases, please attach mockup of your goal.
http://api.highcharts.com/highstock#Renderer
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.
I am trying to get used to Shinobi charts developed for iOS. I've downloaded trial version on same and trying to plot some sample charts using it. The charts look pretty good in demo apps. But one thing I noticed that while using class SChartColumnSeries to plot bar chart, the width of the bars is adjusted according to the frame available to plot the chart. I want it to be fixed (say 20 pixels) regardless of number of bars present and if the width required is more than what is assigned (while assigning frame to the chart) then only some part of the chart will be visible and user can scroll the chart to view remaining bars (This is possible in Core Plot). How can I achieve this using Shinobi charts?
This is possible with Shinobi, but it's not a simple case of setting a fixed width property I'm afraid. I've just tried to do this though and its isn't too complicated!
My advice would be to set up the chart like this:
chart = [[ShinobiChart alloc] initWithFrame:self.view.bounds];
[chart setAutoresizingMask:UIViewAutoresizingFlexibleHeight | UIViewAutoresizingFlexibleWidth];
[chart setDatasource:d];
[chart setXAxis:[SChartNumberAxis new]];
[chart setYAxis:[SChartNumberAxis new]];
[[chart xAxis] setEnableGesturePanning:YES];
[[chart xAxis] setEnableGestureZooming:NO];
[chart.xAxis setDefaultRange:[[SChartNumberRange alloc] initWithMinimum:#5 andMaximum:#10]];
The most important part is the last 3 lines. By turning zooming off you allow your charts to have a fixed zoom level, meaning the bars stay the same width. You can turn the panning on to allow users to scroll to see different bars.
The last line sets the default range. Here, i've just set it to values between 5 and 10. That means that the chart displays values between 5 and 10 along the x-axis.
By doing the above, this means that your columns will have a fixed width! You might have to do some tweaking and / or calculation depending on how many data points you have, in order to find out what you have to set your default range to. If they are variable for example, you will need to take into account the number of data points, the padding between the columns and inter column padding and the number of pixels you have available).
I realise this is quite a simplified answer but it should give you a good starting point!