Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>first i use as my x axis</p> <p><strong>Edit</strong> how i make my x axis:</p> <pre><code>SChartNumberRange *r1 = [[SChartNumberRange alloc] initWithMinimum:[NSNumber numberWithInt:0] andMaximum:[NSNumber numberWithInt:2]]; SChartCategoryAxis *xAxis = [[SChartCategoryAxis alloc] initWithRange:r1]; xAxis.title = @""; //xAxis.enableGesturePanning = YES; xAxis.enableGesturePanning = YES; xAxis.style.gridStripeStyle.showGridStripes = NO; xAxis.style.majorGridLineStyle.showMajorGridLines = NO; </code></pre> <p>when you make you data points it should use the xValue as the x axis point. like this:</p> <pre><code>dp.yValue = 1000; dp.xValue = @"Jan"; </code></pre> <p>the xValue should be set as the x point for that particular data point. This should work, but if it doesn't or you want to do something more complex you can extend this method from <code>SChartDelegate</code> protocol:</p> <pre><code>-(void)sChart:(ShinobiChart *)chart alterTickMark:(SChartTickMark *)tickMark beforeAddingToAxis:(SChartAxis *)axis </code></pre> <p>in this method you have the <code>tickMark.tickLabel</code>is the axis label for that given point where you can do your editing. Don't forget to verify what axis your on.</p> <p>Hope this helps. If not tomorrow i can post you some code from my project (currently i don't have access to it from where i am)</p> <p><strong>Edit:</strong> currently i have this code:</p> <pre><code>- (void)sChart:(ShinobiChart *)chart alterTickMark:(SChartTickMark *)tickMark beforeAddingToAxis:(SChartAxis *)axis { if (chart.yAxis == axis ) return; for (UIView *i in tickMark.tickMarkView.subviews) [i removeFromSuperview]; tickMark.tickMarkView.frame = CGRectMake(0, 0, 170, 75); //center the marker at the right place because the size was changed tickMark.tickMarkX = tickMark.tickMarkX - (tickMark.tickMarkView.frame.size.width/2) ; tickMark.tickMarkY = 10; //img UIImageView *img = [[UIImageView alloc] initWithImage:[UIImage imageNamed: @"graph_bar_tag_2@2x.png"]]; img.frame = CGRectMake( 0, 0, tickMark.tickMarkView.frame.size.width, tickMark.tickMarkView.frame.size.height); [tickMark.tickMarkView addSubview:img]; //label with the markView's size with 7px padding on the left and on the right UILabel *label = [[UILabel alloc] initWithFrame: CGRectMake( 7, 5, tickMark.tickMarkView.frame.size.width-14, 15)]; label.backgroundColor = [UIColor clearColor]; //tikMark.tickLabel has an pair of indexes so that i can easily find the data for this particular data point and series. label.text = [_dataSource getNameFor: tickMark.tickLabel.text]; label.textAlignment = UITextAlignmentCenter; //color_other_light is a UIColor var [label setTextColor: color_other_light]; [tickMark.tickMarkView addSubview:label]; ... } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload