This is a migrated thread and some comments may be shown as answers.

How can add the Y-axis values and line graph Values in charts(animations-custom animation line chart)?

1 Answer 56 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Nandu
Top achievements
Rank 1
Nandu asked on 02 Sep 2015, 01:56 PM

Hi,

Im using this sample, I'm  implementing line chart in animations. In sample you are implemented random numbers but in application i have 2 different values of y-axis and line graph. how to compare the y-axis values and line graph values.

im storing the dates and graph values in 2 different arrays of dataArray and fillAmount array.

how can i pass the values to y-axis and line graph?

for (int i = 0; i<10; i++) {
        [points addObject:[[TKChartDataPoint alloc] initWithX:[dateArray objectAtIndex:i] Y:@(arc4random() % 100)]];
    }

i don't want to give the random values, how to match the x-axis values and y-axis values 

Please help me

Thanks in Advance.

1 Answer, 1 is accepted

Sort by
0
Sophi
Telerik team
answered on 03 Sep 2015, 07:14 AM
Hello Nando,

Thank you for contacting us. 

If I understand correctly you have two arrays - one with dates(dateArray) and one with numeric values(fillAmount). They both should have equal number of elements so that each element from the dateArray have a corresponding one from the fillAmount array. On each iteration of your loop you should create a TKChartDataPoint with X-value from dateArray and Y-value from fillAmount array. If this is the case, you can consider the following code snippet:
for (int i = 0; i<10; i++) {
        [points addObject:[[TKChartDataPoint alloc] initWithX:[dateArray objectAtIndex:i] Y:[fillAmount objectAtIndex:i]];
    }

I hope this helps. Do not hesitate to write back if you need further assistance, .

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
Tags
Chart
Asked by
Nandu
Top achievements
Rank 1
Answers by
Sophi
Telerik team
Share this question
or