Display slice of a donut series


#1

Please give an example to display half or quarter series (other than full donut series.)

I am passing parameters using drawSlice of SChartDonutSeries but it is not working :slight_frown:Please help!!!itz urgent


#2

Hi Arti,

Do you mean you are using this method? If so, you shouldn’t be using that method as it is depricated.

By display half or a quarter of a series, do you mean like in this forum post?

Thanks,

Jan


#3

Hi Jan,

Yes,I already tried that forum post .In that i am facing problem like each series span as 360 degree.

My requirement is if as a user i achieved 50 percent of my task ,then donut series should span upto 180 degree i.e. only half donut should be visible.

So what i did is[where d1 is my object of SChartDonutSeries]:

d1.style.flavourColors = [NSMutableArrayarrayWithObjects:[UIColorredColor], [UIColorclearColor], nil];
    d1.style.showFlavour = YES;
     d1.selectedStyle.showFlavour = YES;
 
 I set other 50 percent as clear color,but if i click on this portion of series,color again appeared...
 
 Eagerly waiting for ur reply..
 
 Thanks,
 Arti

 


#4

I did this to solve my problem :grin:

d1.style.flavourColors = [NSMutableArrayarrayWithObjects:[UIColorredColor], [UIColorclearColor], nil];
    d1.selectedStyle.flavourColors = [NSMutableArrayarrayWithObjects:[UIColorredColor],[UIColorclearColor], nil];
    d1.style.showFlavour = YES;
     d1.selectedStyle.showFlavour = YES;
    
     // Turn off the chart's shiny bevel.
     d1.style.chartEffect = SChartRadialChartEffectFlat;

But if you have better alternative,then suggestion will be welcomed.

Thanks,

Arti


#5

Hi jan,

Itz not a feasible solution for my case.Please suggest me something

:slight_frown:

Regards,

Arti


#6

Hi jan,

Itz not a feasible solution for my case.Please suggest me something

:slight_frown:

Regards,

Arti


#7

Hi Arti,

It seems to me as though this thread & your other thread are related to the same question, am I correct?

Could you please explain why the code you posted above isn’t feasible?

Jan


#8

yes,firstly sry for two queries.

I am very new to shinobi framework so might be i am wrong

 I think  i have to take extra slice and then hide it.

For that I have to set their data points as nil

SChartRadialDataPoint *dp = [SChartRadialDataPointnew];
 if(dataIndex == 0)
 then itz ok
 
 but for other slice I have to set datapoints.I dont want to show it on my view.What should i do to hide datapoint value
 if(dataIndex == 1)
 dp.name = @"";
 dp.value =

#9

If you are trying to create a donut chart like in the forum thread I liked above, the right approach would be to make a slice clearColor as you were attempting, rather than trying to give it a nil data value.

Jan