5 Answers, 1 is accepted
0
Hello Ramya,
Thank you for contacting us.
You can give custom color to TKChartLineSeries by adding a custom TKChartPaletteItem to the palette property of TKChartLineSeries.
Yes, there is a way to set different color for every datapoint in your chart. You should adopt TKChartDelegate protocol and implement its chart:paletteItemForPoint:inSeries: method.
I hope this helps.
If you have any other questions do not hesitate to contact us.
Regards,
Sophi
Telerik
Thank you for contacting us.
You can give custom color to TKChartLineSeries by adding a custom TKChartPaletteItem to the palette property of TKChartLineSeries.
TKChartLineSeries* seriesForIncomes = [[
TKChartLineSeries
alloc]
initWithItems
:pointsWithCategoriesAndValues];
seriesForIncomes
.style
.palette
= [[
TKChartPalette
alloc]
init
];
TKChartPaletteItem
*item = [[
TKChartPaletteItem
alloc]
init
];
item
.stroke
= [TKStroke
strokeWithColor
:[
UIColor
purpleColor
]];
[seriesForIncomes
.style
.palette
addPaletteItem
:item];
Yes, there is a way to set different color for every datapoint in your chart. You should adopt TKChartDelegate protocol and implement its chart:paletteItemForPoint:inSeries: method.
-(
TKChartPaletteItem
*)chart:(
TKChart
*)chart
paletteItemForPoint
:(
NSUInteger
)index
inSeries
:(
TKChartSeries
*)series{
NSArray
*colors = [
NSArray
arrayWithObjects
:[
UIColor
blackColor
], [
UIColor
greenColor
], [
UIColor
redColor
], [
UIColor
orangeColor
], [
UIColor
yellowColor
], [
UIColor
brownColor
],
nil
];
TKChartPaletteItem
*item = [[
TKChartPaletteItem
alloc]
init
];
item
.fill
= [TKSolidFill
solidFillWithColor
:[colors
objectAtIndex
:index]];
return
item;
}
I hope this helps.
If you have any other questions do not hesitate to contact us.
Regards,
Sophi
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
ramya
Top achievements
Rank 1
answered on 08 Jun 2015, 11:26 AM
Thank you so much.
0
Hey Ramya,
I am glad I was able to help. If you have other questions do not hesitate to contact us.
Regards,
Sophi
Telerik
I am glad I was able to help. If you have other questions do not hesitate to contact us.
Regards,
Sophi
Telerik
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Feedback Portal
and vote to affect the priority of the items
0
Doug
Top achievements
Rank 1
answered on 29 Mar 2017, 01:25 PM
need this in vb.net
0
Hello,
We do not provide VB.NET code samples but you could use a online converter to do the conversion.
Regards,
Deyan
Telerik by Progress
We do not provide VB.NET code samples but you could use a online converter to do the conversion.
Regards,
Deyan
Telerik by Progress
Want to build beautiful Android apps as well? Check out UI for Android which enables the same set of scenarios, allowing you to create the same great app experience on both iOS and Android.