I’m trying to create a horizontal bar chart, with bars starting at 0 point on the left then going to the right. I do this by putting the X axis at the left and the Y Axis on the bottom. However, setting the X Axis in the Left or Right area still produces a bar chart with the bars starting at 0 on the right and going left.
I thought I could make the Y Axis flipped and this might help. For example, there’s a property called ‘isAxisFlipped’ in SciAxis2D protocol. However, calling has no effect because is says the SciNumericAxis hasn’t implemented this method. I tried subclassing SciNumericAxis and overriding the isAxisFlipped method myself to return true. However, this has no effect as I don’t see this method ever getting called by anyone else.
So, is there a way to do horizontal columns/bar that go left to right?
Sorry for slow response
To achieve desired behaviour you need to do following steps:
1) Create Y axis, set alignment Top or Bottom, set it flipped and attach to surface
id<SCIAxis2D> yAxis = [[SCINumericAxis alloc] init]; yAxis.axisId = @"yAxis"; [yAxis setFlipCoordinates:YES]; [yAxis setAxisAlignment:SCIAxisAlignment_Top]; [surface attachAxis:yAxis IsXAxis:NO];
2) Create X axis, set alignemnt Left or Right and attach to surface
id<SCIAxis2D> xAxis = [[SCIDateTimeAxis alloc] init]; xAxis.axisId = @"xAxis"; [xAxis setAxisAlignment:SCIAxisAlignment_Left]; [surface attachAxis:xAxis IsXAxis:YES];
Please let me know if it solved your problem.
I’ve added resulting charts in attachment, if it is not what you want to achieve, send some scetch drawing with desired charts layout, please
SciChart iOS Developer
Please login first to submit.